This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Today I finally got the server admins to upgrade from Tomcat 4.1 to Tomcat 6.0.18.
Now I want to get rid of scriptlets and use JSTL and EL.
Does Tomcat 6.0.18 automatically come with JSTL and EL already set up or do I need to load anything in the lib directory or change settings for JSTL and EL to work?
First Expression language is part of JSP specification so no need to add any library. And for the JSTL is you use Java EE 5.0 version then you don't need to add JSTL library for that but if you are using older java version then you have to use or add JSTL lib at WEB-INF/lib folder.
Bear Bibeault wrote:The EL is part of JSP and will be enabled if you declare the web.xml correctly (see JSP FAQ). Download the Jakarata version of JSTL 1.2 (single jar file) and drop it into WEB-INF/lib.
For 1.0 and 1.1 there are two jars: jstl.jar and standard.jar. For 1.2, just jstl.jar.
From the link above, you'd only need jstl-1.2.jar.
Joined: Feb 11, 2006
Just to make sure I am on the right track on my Windows development workstation because I really want to get out of scriptlets asap. I have EL working by changing my web.xml to the correct info that came in the Tomcat example apps.
Now I need to get JSTL working.
I downloaded JSTL 1.1 from Jarkarta JSTL
I see two files in zipped info in \jakarta-taglibs-standard-1.1.2\lib directory called:
I need to put these two files and put them in webapps\myAppName\WEB-INF\lib?
For JSTL 1.1, both jars are needed (they are combined in 1.2).
And the tutorial you pointed to is very out-dated (circa 2002), making a very common mistake. You do not put the TLD files anywhere. They are embedded in the jar file and the container will find them there.
You also do not put anything in the web.xml to declare them. Just use the proper URI in the taglib directive on the pages themselves.
And lastly, the URI in the tutorial is for JSTL 1.0 -- not 1.1 or 1.2.
Reference the JSP FAQ, and ignore that out-dated tutorial.