6 Replies Latest reply on Dec 2, 2002 10:31 AM by ian.fallon

    how to deploy taglibs in jboss

    meixiaolong

      hello,everyone,
      I have some problems about taglibs,I don't know how to deploy taglibs in jboss,can anyone tell me?
      thanks in advance!

        • 1. Re: how to deploy taglibs in jboss
          gfzhang

          1. place the jar and tld(for example, taglib.tld) into web-inf/lib

          2. add the following into web.xml

          <taglib-uri>vnextaglib</taglib-uri>
          <taglib-location>/WEB-INF/lib/taglib.tld</taglib-location>


          3. in jsp
          <%@ taglib uri="vnextaglib" prefix="vnex" %>

          <vnex:mytag......

          • 2. Re: how to deploy taglibs in jboss
            meixiaolong

            thanks.

            • 3. Re: how to deploy taglibs in jboss
              gfzhang

              you can also put the tag classes into web-inf/classes, need not to jar them.

              • 4. Re: how to deploy taglibs in jboss
                ian.fallon

                I also have the problem of taglibs not working. Tried the above (and a million variations in the web-client.xml file) but still no luck.

                Assuming I'm working from the JBoss template project, are there modifications to the build.xml / .ant.properties required as well as the above ?

                Also, how would one incorporate the building of the tag library from it's .java file ?

                A simple example of using a taglib would be very much appreciated.

                Is there anyway of telling what's wrong when the web-client.xml file is wrong ? I seem to just get HTTP ERROR: 404 when trying to view the JSP which is not helpful in terms of debugging the actual problem. The Ant compilation and deployment produces no errors either!

                Regards,

                Ian (JBoss beginnner)

                • 5. Re: how to deploy taglibs in jboss
                  ian.fallon

                  Have solved the problem of getting it working now - had a bug in the web-client.xml file.

                  Would be interested in whether there's any way of finding out more debugging info available for future errors.

                  For anyone else out there wanting to compile tag libs, just put the .java files under src/main/servlet then your package path. Put the .jsp and .tld under /main/web. Edit the web-client.xml file as described above.

                  Regards,

                  Ian

                  • 6. Re: how to deploy taglibs in jboss
                    ian.fallon

                    I should say, the web-client.xml file looked like this in my case:


                    <taglib-uri>HeadingTag</taglib-uri>
                    <taglib-location>csajsp-taglib.tld</taglib-location>


                    i.e. no need to specify package names here.

                    Ian (testing with the "Core Servlets" book taglibs!)