• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL and EL

 
Joseph Smithern
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

 
Steven Elliott
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you need to download jstl-1.2.jar.md5 or jstl-1.2.jar ?

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which jar do we need to download; that part is not clear to me.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic