Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does JSP Nested Tag Handler gets invoked?

 
Mani Rai
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic