This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
If my jsp file is calling SimpleTag in this way. Now, the moment it gets on to the 3rd tag, which is not having the body, the setJspBody method will not be called. Hence, JspBody will be null. So, if we have to print the value, we will not be able to use the JspWriter, because JspWriter is got from the JspBody object. Thus, how should my java file which extends SimpleTag be. I am confused.
Joined: Sep 02, 2005
Srini, Still I have to read more on Tag handlers. I can answer your question when I get to that point. But why do u want to take jspwriter object from jspBody. Cannot you take form jspcontext which is available for any tag class? as getJspContext().getOut().write(attrValue);
Joined: Nov 07, 2004
Hi Rizwan, Sorry I was wrong during my previous post. I did not mean getJspBody().getOut(), but instead I meant getJspBody().invoke(null). In this case, it turns out to be null, thus when we try to do it, it gives a big NullPointer exception.