3. (Before)My Body(After)
4. (Before)My Body
I tested it and its working fine! yes the answer comes out as 3 only but why? What i have read as valid return types for doStartTag are SKIP_BODY and EVAL_BODY_INCLUDE but its working correctly here. Can anyone explain why?
| Pursuing Bachelor of Engineering | OSUM Club Leader | SCJP 6 | SCWCD 5 |...
These are really trick questions that you won't come across on the real exam, don't worry about them too much.
First of all: it compiles because SKIP_PAGE is defined as a public static final int, the compiler doesn't know whether that value applies in this method
Secondly: it runs because the generated Servlet checks only on whether the body should be skipped: see part of the generated code (on tomcat):
The JSP2.0 spec doesn't say anything about what should be done if there is a wrong return code thrown from one the tag-methods, so I find the outcome of this question questionable.