Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1602

Can't use container level taglibs




      JBoss/Tomcat needs a way to install tag libraries globally so they are available to all web applications. This functionality is mentioned in the JSP 2.0 spec section 7.3.5. In Tomcat standalone, you can do this, but it doesn?t work in JBoss/Tomcat.

      The way this works is that the Jasper TldLocationsCache ?Scans all JARs accessible to the webapp's classloader and its parent classloaders for TLDs.?

      If I put my jar into Tomcat standalone?s common/lib directory then the tag library will be shared across all web apps. I?ve tried putting the jar in several ?well known? locations in JBoss/Tomcat and nothing seems to work.

      For Reference, I?ve attached the TldLocationsCache source code from Tomcat 5.5.8.

      Concerning TldLocationsCache, Scott Stark says:

      "This class is useless for non-URLClassLoaders and URLClassLoaders that do not expose their classpath via getURLs which is what we currently do because of an old bad behavior with annotated codebases of rmi classes. "

      Remy Maucherat offered this as a possible solution:

      Would it be possible to have the ENCLoader facade return more interesting things ?


      • A trival extension of URLClassLoader that uses an empty URL[] as its
      • classpath so that all work is delegated to its parent.
        static class ENCLoader extends URLClassLoader
        private URL[] urllist = new URL[0];
        ENCLoader(ClassLoader parent) { super(new URL[0], parent); }

        void addURLInternal(URL url)

        { URL[] result = new URL[urllist.length + 1]; for (int i = 0; i < urllist.length; i++) result[i] = urllist[i]; result[urllist.length] = url; urllist = result; }

      public URL[] getURLs()

      { return urllist; }


        Gliffy Diagrams




              • Assignee:
                starksm64 Scott Stark
                ssilvert Stan Silvert
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: