- This topic has 4 replies, 3 voices, and was last updated 20 years, 1 month ago by Riyad Kalla.
-
AuthorPosts
-
Jeremy KuhnashMemberFirst off, sorry if I have missed this topic elsewhere…
I noticed that when I select certain features like ‘Add JSF capabilities’ or ‘Add JSTL capabilities’ that the web.xml is not updated with the taglib entries.
Of course, this isn’t a huge thing to do by hand, and you only have to do it once per project. On the flip side, I guess that is the point of why I am asking about it – it probably wouldn’t be a big deal to have myEclipse manage these web.xml entries, either. I am pretty sure I could just throw some XSLT at the issue at the end of the ‘enable capability’ step….
Thanks for the great product.
— Jeremy
Scott AndersonParticipantJeremy,
You only need to add your taglib entries to web.xml if you want to remap the URI’s. If you use the URI’s specified in the taglib, as most seem to, then just adding the jars containing the taglibs to the build path, which is done by the wizards, is quite enough. It’s really up to you if you want to refer to them differently than they refer to themselves, and if you do you need to add them to web.xml.
Thanks for the great product.
We’re trying. 😉 Thanks for the feedback.
Jeremy KuhnashMemberHey Scott – I guess my confusion (and assumptions) stemmed from the fact that the JSP editor complains about the taglib path not being found.
Of course, I think I posted this after creating a fresh web module, adding the struts capabilities and then seeing these errors in the JSP editor after adding an index.jsp with these 2 lines:
<%@ taglib uri=”/tags/struts-logic” prefix=”logic” %>
<logic:redirect forward=”welcome”/>My application does in fact work, though, so Tomcat obviously sees the jars better than the IDE is at this point.. Maybe this would have been better posted to the ‘problems’ section of the forums.
As always, thanks for the response, community and great feedback.
— Jeremy
Riyad KallaMemberJeremy,
I’m not sure how this page actually works unless you have added web.xml entries mapping the struts-logic tags to the URI “/tags/struts-logic”. If you open the struts.jar file, and go into the META-INF/tld directory and open the .tld files, you’ll notice near the top a tag called <uri> that provides a default URI for the tags, something like:http://jakarta.apache.org/struts/tags-logic
You can use these URIs (which our templates use) without any changes to your web.xml file as long as the struts.jar file is in your build path. The web application spec defines 2 methods of TLD resolution, 1) is via the web.xml file, and 2) is via TLD files under the META-INF directory in any JARs in the classpath.
But the example you give above shows a completely custom URI which means ME is hunting around its registry of TLDs for the key “/tags/struts-logic” and finding nothing; that’s why I don’t get how Tomcat is finding this tag. The URI is a unique ID, not a URL (locator, like a path), its used as a key to find resources in a sort of registry of TLDs from the runtime env (either App server or ME).
I provided this info to clarify what is going on to maybe help you with your situation, but you work with whatever feels right for this project. Let us know if you run into any hickups.
Riyad KallaMemberMoving to support
-
AuthorPosts