Is it possible to get tld files from WEB-INF \ lib \ {*. Jar} \ META-INF \ resources \ WEB-INF?

I have a jsp file that includes a tag like:

<%@ taglib prefix="abc" uri="/WEB-INF/tlds/xyz.tld" %>

      

and in my application the deployment structure is:

WEB-INF
  |-lib
      |-some.jar
          |-META-INF
              |-resources
                  |-WEB-INF
                      |-tlds
                          |-xyz.tld

      

this works fine in Tomcat 7, but when I deploy my application to JBoss as 7 it cannot find the tld file.

so is this a JBoss issue (doesn't support Servlet3.0?) or the tld files just can't be accessed from the META-INF \ resources \ WEB-INF directory in the jar?

+3


source to share


1 answer


This is not a Servlet 3.0 issue, this is a JSP 2.2 issue. (They are different specifications).

The uri

taglib part of the declaration is not a location. This is the key and must match the content

<uri>your/tld/uri</uri>

      



in the tld file.

If this element is missing, you have to declare it in the taglib map in web.xml, specifying the uri there:

<jsp-config>
     <taglib>
         <taglib-uri>/WEB-INF/tlds/xyz.tld</taglib-uri>
         <taglib-location>/WEB-INF/lib/some.jar/META-INF/resources/WEB-INF/tlds/xyz.tld</taglib-location>
     </taglib>
</jsp-config>

      

+4


source







All Articles