iterations property in for tag is not checked at the start of the tag. Thus, if begin value is 0 and number of iterations is 0 still the tag gets executed once. This leads to index out of bounds exceptions in some situations. This needs to be checked in start tag. public int doStartTag() { if ( iterations > 0 ) { return EVAL_BODY_TAG; } else { return SKIP_BODY; } } Simillarly in IF tag the java scriptlets get executed for both then and else parts and only html part is not displayed. This is not intended the body should be skipped at the start only as nothing should be excuted in else tag / in if tag depending on condition. Thus in IFThenTag it is necessary to do following : if( ! parent.getCondition() ) { return SKIP_BODY; } Similarly in IFElse Tag : if( parent.getCondition() ) { return SKIP_BODY; } Hope this helps. Regards, Sachin
The utility taglib is deprecated. It was only an example tag library. Thanks for submitting the patch.