The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Nested Simple tags Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Nested Simple tags" Watch "Nested Simple tags" New topic
Author

Nested Simple tags

padma jyotsna
Greenhorn

Joined: Jun 07, 2010
Posts: 17
Hi all,

I have a question on Simple tags.
Suppose there is a Simple tag handler class with <name>mytag<name> in the TLD

considering the taglib directive is set appropriately in the jsp,
and calling nested tags as shown below , how many instances of the tag handler class will be created?

<test:mytag>
<test:mytag>
<test:mytag/>
</test:mytag>
</test:mytag>

will there be only One instance created.
or because Simple tag handler class instances are not reused by the container, for every tag invocation in the jsp, a new instance is created?

As per my understanding, there will be 3 instances created. is that correct?

Thanks
Frits Walraven
Rancher

Joined: Apr 07, 2010
Posts: 1066

As per my understanding, there will be 3 instances created. is that correct?

That is correct.

Regards,
Frits
padma jyotsna
Greenhorn

Joined: Jun 07, 2010
Posts: 17
Thanks Frits
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Nested Simple tags
 
Similar Threads
Final Mock Exam question 19
Custom Tags & Threading
classic Tag
Doubts in Mock exam HFSJ
Instances of Tag Handler