This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
Joined: Jan 20, 2010
whew..so this worked because it was like this on tomcat 5