3 Replies Latest reply on Nov 25, 2004 10:15 PM by camel

    Why is JSTL not included?

    jimpo

      I just spent a few (too many) moments getting my head around the whole JSTL situation. It seems that none of JSTL is supplied "out of the box" with JBoss / Tomcat, and I had to include standard.jar and jstl.jar to get my JSTL tags working. It seems odd that so central piece is not included readily!

      - why is JSTL not part of JBoss / Tomcat distribution?
      - gathering the big picture from various sources, I got the image that JSTL is not part of J2EE standard. Am I correct? How is this possible, even JSP specification refers to JSTL in many places!

        • 1. Re: Why is JSTL not included?
          camel

          My understanding is that JSTL (including the expression language (EL)) is fully supported by Tomcat 5+, which ships with current versions of JBoss. I'm using JSTL and EL under JBoss 3.2.6 and 4.0.0.

          I did have a problem initially with JBoss (an older version, maybe 3.2.3) finding the JSTL .tld files. I fixed it by adding the following to the end of my web.xml file:

          <!-- JSTL Tag Library Descriptors -->
          <taglib>
           <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
           <taglib-location>/WEB-INF/jstl/c.tld</taglib-location>
          </taglib>
          <taglib>
           <taglib-uri>http://java.sun.com/jsp/jstl/xml</taglib-uri>
           <taglib-location>/WEB-INF/jstl/x.tld</taglib-location>
          </taglib>
          <taglib>
           <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
           <taglib-location>/WEB-INF/jstl/fmt.tld</taglib-location>
          </taglib>
          <taglib>
           <taglib-uri>http://java.sun.com/jsp/jstl/sql</taglib-uri>
           <taglib-location>/WEB-INF/jstl/sql.tld</taglib-location>
          </taglib>
          <taglib>
           <taglib-uri>http://java.sun.com/jsp/jstl/functions</taglib-uri>
           <taglib-location>/WEB-INF/jstl/fn.tld</taglib-location>
          </taglib>
          

          And I have those 5 .tld files in my WAR file in /WEB-INF/jstl/ as indicated above.

          Also note that I am using the web.xml 2.4 spec version, not sure if this makes any difference.


          • 2. Re: Why is JSTL not included?
            jimpo

            OK, so it might be that JSTL is included, but to "activate" it you need to include .tlds and add the definitions to your web.xml?

            The alternative way (dropping standard.jar and jstl.jar to WEB-INF/lib) seems much less hassle and I think I will use it.

            • 3. Re: Why is JSTL not included?
              camel

              Actually I just checked, and I DO have jstl.jar and standard.jar in my /WEB-INF/lib/ directory of my war file. I tried removing them and I got an exception "javax.servlet.ServletException: org.apache.taglibs.standard.tag.rt.core.IfTag....". So it would seem you do need those jar files in the WAR. Sorry I didn't mention that in my previous message.