File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Custom tag: Nested or Co-operative?

 
Bilupto Zena
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic