• 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 do I create my own tags under the Servlet 2.4 API?

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've earlier only dealt with the Servlet 2.3 API for creating my own tags. Then I would just extend the "javax.servlet.jsp.tagext.TagSupport" in my tag class, and put the class into a TLD and then put the TLD into web.xml.

But in the Servlet 2.4 API the "javax.servlet.jsp.tagext.TagSupport" is taken away. How do I create my own tags under the Servlet 2.4 API?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SimpleTagSupport

Article on SimpleTagSupport
 
Egil Poma
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looking at the SimpleTagSupport link you gave, I should extend "javax.servlet.jsp.tagext.SimpleTagSupport".

When I download the latest Tomcat (5.5) and use the servlet-api.jar provided there (which according to the Tomcat docs is the Servet 2.4 API), that class don't exist.

Am I missing something here?
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The tomcat docs do mention this class. How did you check to see whether this class exists or not?
 
Egil Poma
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I downoad and unpack Tomcat, I'm looking in the /common/lib/ directory.

I just open up the servlet-api.jar, and check if the "javax.servlet.jsp.tagext.TagSupport" exists.

After some checking it looks like they've put all the tag classes into jsp-api.jar. Looks like I'll need to include that jar in the class path to make it work .
 
Sheriff
Posts: 67746
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
Not a servlet question. Moved to the JSP forum.
 
Bear Bibeault
Sheriff
Posts: 67746
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

Originally posted by Egil Poma:

But in the Servlet 2.4 API the "javax.servlet.jsp.tagext.TagSupport" is taken away.



Incorrect. What led you to this erroneous conclusion?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TagSupport is not -and has never been- part of servlet-api.jar; it's in jsp-api.jar
 
Bear Bibeault
Sheriff
Posts: 67746
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

Originally posted by Ulf Dittmer:
TagSupport is not -and has never been- part of servlet-api.jar; it's in jsp-api.jar



Perhaps the point of confusion is that, prior to Tomcat 5, the servlet and JSP APIs were both bundled into the same jar file.

However, anyone who is writing web applications should have a copy of the Servlet and JSP specifications handy, in which case it would be quite clear that even though the SimpleTag mechanism has been added with JSP 2.0, that the "classic" tag handling mechanism provided by Tag and TagSupport is still available.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic