on 04-17-2007 1:55 AM
I'm currently constructing some DC's to hold Struts on our nw2004s server. I've created one DC to hold all the main struts jars, and a few other DC's to hold the ancillary jar files used by Struts (and by other non web-based applications). References have been set between the libs, and mostly everything seems to work.
With the current version of Struts (1.3.8), the tld files are contained in the jar files, and they can be found in the META-INF/tld directory. Supposedly, I do NOT have to specify anything in web.xml to find these tld files, as long as I use the default uri's. For example, the default Tiles TLD uri is http://struts.apache.org/tags-tiles. When I was initially testing Struts, I created a web app that contained all the Struts jar files, and the tld's were findable without specifying anything in the web.xml, as long as I used the default URI's.
If I place
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
in my JSP, I get a compilation error indicating that the tld file can't be found, so the tld resource can't be found...
I've tried creating a mapping in the web.xml mapping the URI to META-INF/td/struts-tiles.tld, but I get the same error. I can fetch the resource from the class loader using the above META-INF path, so the file is findable, yet Struts can't find it.
The only way I can make this work is to place the tld files in the WEB-INF directory of the web app, which is something I DO NOT want to do - the tld files are already in the jar files, so why should I have to duplicate them.
Has anyone else placed struts into a DC, and if so, were you able to reference the tld files in the jar files, or did you have to copy them into the WEB-INF directory?
My only thought on this is that this is a class loader issue, but if I can find the resource from the primary application, the child (Struts) should be able to find it.
I'm stumped. Help!
This appears to be a class loader issue - the only solution I've found is to place the TLD's in the WEB-INF directory.
Of course, incorporating the struts jar files directly into the web app also works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ken
u are right that you will be able to find from WEB-INF directory but not from jar files.
Make sure you add these jar files inside Classpath and JAR Dependencies under properties in which project u want to access it.
My IDE is WSAD5.0
if it does not work add it inside
Project Utility JARs .....but not sure
Riyaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.