It's not a secret anymore!*
The moose likes JSP and the fly likes JSTL and EL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL and EL " Watch "JSTL and EL " New topic
Author

JSTL and EL

Joseph Smithern
Ranch Hand

Joined: Feb 11, 2006
Posts: 89
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?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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.

Welcome to the modern world!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 684


Hi,

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.



Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Steven Elliott
Greenhorn

Joined: Mar 28, 2002
Posts: 14
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.


I don't believe Jakarta has a release version of JSTL 1.2 (yet). The Sun version can be had from
https://maven-repository.dev.java.net/repository/jstl/jars/

As Bear mentioned your taglib will need to include jsp/jstl not just jstl.

I believe you will need these to run TC6 from Eclipse.

have fun!
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
Do you need to download jstl-1.2.jar.md5 or jstl-1.2.jar ?

Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Steven Elliott wrote:As Bear mentioned your taglib will need to include jsp/jstl not just jstl.
To be clear, we're talking about the URI used in the taglib declarations. Be sure to use the correct one.
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
Which jar do we need to download; that part is not clear to me.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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.
Joseph Smithern
Ranch Hand

Joined: Feb 11, 2006
Posts: 89
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:
jstl.jar
standard.jar

I need to put these two files and put them in webapps\myAppName\WEB-INF\lib?

Then continue on as discussed in this tutorial?


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

P.S. What version of Tomcat are you using? Make sure you use the correct version of JSTL for it.

Tomcat 4 = JSTL 1.0
Tomcat 5 = JSTL 1.1
Tomcat 6 = JSTL 1.2

Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
Hi there!

I am working on the same, we will see each other a lot of times I think xD

Yes, I think you only need those two libraries to run JSTL, but you can download JSTL 1.2 instead of 1.1, Tomcat 6.0.18 runs with it without problem
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL and EL
 
Similar Threads
Passing a list of beans to jsp
EL doubt
Arithmetic value of "" in EL expressions
jstl in tomcat 6.0
JSTL and EL