This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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

How does JSP Nested Tag Handler gets invoked?

Mani Rai

Joined: Dec 26, 2012
Posts: 5
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: 299
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(); ).

Have you checked out Aspose?
subject: How does JSP Nested Tag Handler gets invoked?
It's not a secret anymore!