Athen
journeyman
Reged: 06/05/07
Posts: 79
Loc: San Francisco, CA
|
|
Posted reader feedback, David wrote:
This is a side point, but I try to point out this misunderstanding every time I see it.
For a very long time, it has not been necessary to have "taglib" elements in your web.xml, nor has it been necessary to store TLD files separately from the taglib jar file. If the taglib directive in the JSP references the URI specified in the TLD contained in the taglib jar file, the taglib element is not required in the web.xml, nor is the separate TLD file necessary.
It's ironic that in your comparison of the web.xml in Struts 1 and Struts 2, you use the taglib elements in the Struts 1 example, but not the Struts 2 example. What's worse is that your taglib directives in the Struts 2 JSP likely don't use the URI specified in the encapsulated TLD, so I don't even think this would work.
Article: Adopting Struts 2.0 http://www.javaworld.com/javaworld/jw-10-2007/jw-10-adoptingstruts2.html
|
raghavendra sai
Unregistered
|
|
Yes, what david said is exactly true, I tried the example given, and it didn't work!! have you checked it before posting the example, whether it is working or not?
|
Sangeetha S
Unregistered
|
|
David,
I Agree with your statement. If the taglib jar file is available, no need to include the taglib element in the web.xml. While comparing web.xml for Struts 1 and Struts 2, the focus was on the elements of the servlet mapping and filter mapping and hence the taglib details have been missed out. If the following taglib element is added to web.xml, the code will work fine.
<taglib> <taglib-uri>/s</taglib-uri> <taglib-location>/WEB-INF/struts-tags.tld</taglib-location> </taglib>
Thanks for pointing this out.
|
Sangeetha S
Unregistered
|
|
All the examples here have been tried before they are posted. Copy the struts-tags.tld to the WEB-INF directory and add a taglib element to the web.xml, the code will work fine.
<taglib> <taglib-uri>/s</taglib-uri> <taglib-location>/WEB-INF/struts-tags.tld</taglib-location> </taglib>
|
Unregistered
|
|
Struts 2.0 is about 5-10x slower than Struts 1.x.
|
Unregistered
|
|
Can you please qualify your statement with facts, more information? I am interested in Struts 2.0 and speed would be a factor. But your post is useless without some more details.
|