> -----Original Message----- > From: Billy Ng [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 27, 2002 12:40 PM > To: Struts Users Mailing List > Subject: taglib url problem > > The c tag cannot find the xml document if the directory is > behind th WEB-INF > directory like: > > <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> > <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %> > <c:import url="/WEB-INF/xml/my.xml" var="xml"/> > <c:import url="/WEB-INF/xml/my.xsl" var="xslt"/> > <x:transform xml="${xml}" xslt="${xslt}"/> > > , but I change the xml directory to root, it will work > > <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> > <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %> > <c:import url="/xml/my.xml" var="xml"/> > <c:import url="/xml/my.xsl" var="xslt"/> > <x:transform xml="${xml}" xslt="${xslt}"/> > > Would anybody please tell me why?
Well, it's sort of related to the fact that the servlet specification says that you can't serve files directly out of the WEB-INF directory. I'm uncertain, but I believe that this was related to a bug in Tomcat 4.0.4. I think in Tomcat 4.1.10, this works. However, there is probably a better way to do this, which is to use the Struts tag that is designed to do this sort of thing, which is "bean:resource". -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

