• 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

JSP Custom tag: Nested or Co-operative?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,


I am trying to create a new custom tag for JSP. Here is the situation:




In the code, first-anchor-tag is anfor insidother custom tag. I am trying to create the new tag inside-tag an incorporate with the first-anchor-tag.
Once the first-anchor-tag get evaluated, I want to create a list of all the keys and values of inside-tag and print it.

I have done some research. But I am new to jsp and custom tag. I know I have to do the following:
1. Add entry to TLD file for "inside-tag".
2. Create and tag handler class for "inside-tag".
3. In the "first-anchor-tag" hanlder file in the doEndTag() method some how I have to make a call to get the list for "inside-tag" variables.


Can some one please give me some idea about how to proceed with this situation?

Many Thanks.

Bilupto.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The fact that you mention doEndTag() reveals that you are using the classic JSP 1 tag handling classes. Why aren't you using JSP 2 simple tag classes?
 
Bilupto Zena
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:The fact that you mention doEndTag() reveals that you are using the classic JSP 1 tag handling classes. Why aren't you using JSP 2 simple tag classes?



That's because the: first-anchor-tag handler class is already created. So I just want to create the new tag and incorporate with the already created one.

 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And you can't change it? If you're mucking around with the tags, now would be a good time to update them from JSP 1 to JSP 2, as the latter has been around for 10 years now.

But, no ever listens, so if you want to continue on your current course investigate the findAncestorWithClass() method of TagSupport.
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic