• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How does JSP Nested Tag Handler gets invoked?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
I don't like that guy. The tiny ad agrees with me.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic