• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP 2.2 forEach tag

 
Eugene Smola
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys. Could you please help me?

I need to use forEach tag in my jsp2.2 application. So, I've included in project classpath Tomcat 7 lib folder. It already contains "jsp-api.jar" (and also servlet-api.jar and el-api.jar's), but the application cannot recognise the line
It gives "The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application" error.

But what's wrong with the jsp2.2? However, I haven't such error with jsp-api-2.1-6.1.0.jar, and it has for example "org.apache.taglibs.standard.tag.el.core.ForEachTag.class" file. Was the jstl deprecated in new servlets? Should I use some another tag lib? Or there is nother way to iterate in JSP page?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if the JSTL is automatically included in JSP 2.2 (haven't upgraded yet), but it was not included in prior versions. You needed to make sure you had the JSTL jar files.

The URI you are using, is incorrect in any case. That's the URI for JSTL 1.0 which most certainly is not the correct one to use with JSP 2+.

See the JSP FAQ for more info.
 
Eugene Smola
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the respone.
Yes, indeed, you right the correct jstl1.2 url is http://java.sun.com/jsp/jstl/core (sorry, just wrong line) but it does not helps. Actually I thought that jsp-api.jar (and another jars) in Tomcat/lib is enough, as Oracle site says "JSTL 1.2 is part of the Java EE 5 platform". But now I see that there is no jstl implementation in Tomcat 6 too. I remained that the jsp-api-2.1-6.1.0.jar with jstl I mentioned was in jetty lib folder.
So, should I include also jstl-1.2.jar, or standard-2.4.jar or maybe another jar which provides jstl implementation? And what's the difference between mentioned jars?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to find the jar file for the JSTL 1.2. Unfortunately, the Apache version isn't ready yet (and the older versions aren;t available at all).

As Oracle's site is no less Byzantine than Sun's was, people are finding it hard to just grab the jar file.

I'll see what I can find.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've made my copy available at:

http://dl.dropbox.com/u/2524225/javaranch/jstl-1.2.jar

Grab it quick -- I can't guarantee that I'll leave it there forever.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, remember, I haven't tried this with JSP 2.2 yet.
 
Stefan Evans
Bartender
Posts: 1822
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSTL1.1 and JSTL1.0 implementations are available from the Jakarta Archives.
They're a bit tricky to find because the direct links from the standard taglibs page are broken

 
Eugene Smola
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you a lot!

Love that forum


For the googlers:you can try to search for the jar in http://mirrors.ibiblio.org/pub/mirrors/maven2/jstl/ folder if the above link will not work there.
 
Abhay Talreja
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:I've made my copy available at:

http://dl.dropbox.com/u/2524225/javaranch/jstl-1.2.jar

Grab it quick -- I can't guarantee that I'll leave it there forever.


Thanks a lot.. i almost struggled to find this for more than 3 hours.. !!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!