• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Struts Taglibs and web.xml

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are the Struts taglibs bundled in the struts.jar file or do I still have declare them in the web.xml file using J2EE 1.4?
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg,
They are bundled in the struts.jar, so you do not need to declare them in the deployment descriptor file.
FK
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using Websphere, the tlds get added to web.xml automatically. I took them out and restarted my server. Sure enough, it still works.
I think this is because the declaration script tags in your jsps tell the container where to find them.
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
You could still use the web.xml to alias the tlds...
<taglib>
<taglib-uri>struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<%@ taglib uri="struts-html" prefix="html" %>
 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marc Peabody:
Using Websphere, the tlds get added to web.xml automatically. I took them out and restarted my server. Sure enough, it still works.
I think this is because the declaration script tags in your jsps tell the container where to find them.
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
You could still use the web.xml to alias the tlds...
<taglib>
<taglib-uri>struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<%@ taglib uri="struts-html" prefix="html" %>



Marc,
You don't actually need any of the tld files inside your WEB-INF directory as they come packed in the struts.jar file. Furthermore, you don't need to define the tlds as you have above, you can simply have the following line:
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
This will find the tags-html from within the jar file sitting in your /WEB-INF/lib directory
HTH
FK
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I lent my own preferences into suggestions.
If I can remember WHY I do it this way... I believe it was because I wanted to run code on a stand-alone box. The more common method would not allow me. If you have deeper insight to this I wouldn't mind learning a thing or two.
You are 100% correct, Faisal. I can't argue with you.
 
I've been selected to go to the moon! All thanks to this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic