wood burning stoves 2.0*
The moose likes JSP and the fly likes How does JSP Nested Tag Handler gets invoked? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How does JSP Nested Tag Handler gets invoked?" Watch "How does JSP Nested Tag Handler gets invoked?" New topic
Author

How does JSP Nested Tag Handler gets invoked?

Mani Rai
Greenhorn

Joined: Dec 26, 2012
Posts: 4
I am learning custom tags based on the example of JEE 5 "Dukes Bookstore". It uses a following nested tags:


My confusion is how does each of the tag handler gets invoked? According to what i understood and following tag handele doTag method:


The nested tag handler should be invoked when getJspBody().invoke(null) is called. Another confusion is, when "definition" tag is called at the very begining, does it completes the doTag method before running other nested tag handlers?
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
As you said the body of the tag (in your case nested tags) will be invoked when the getJspBody().invoke(null); happens. About your last question and just talking about your example, answer is no. doTag method starts, then creates a HashMap and immediately after that it invokes the doTag method of your tt:screen tag, you can see that by debugging both methods. When it has finished the doTag of your nested tag will continue with the execution of the next line (Definition definition = new Definition(); ).

Cheers!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does JSP Nested Tag Handler gets invoked?
 
Similar Threads
Want to write dynamically to HTML attribute within JSP. How to do this?
How to Write Such a Custom Tag
Can't deploy code for taglibs on Tomcat 5.5
JBoss - multiple vagueness
Duke's Bank app