• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot import Taglib JSTL

 
Flavio Ortellao
Greenhorn
Posts: 6
Eclipse IDE Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cant find jstl.jar in the web. Sun's page... I mean... Oracle's page says that JSTL is now part of JavaEE 5 platform. I'm using JDK1.5.0 and Tomcat 6, but when I put <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> in my JSP, i get an error sayin that Eclipse (Helios) cannot find the tag descriptor.
Does anyone knows what I'm missing?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you need to find a JSTL 1.2 or 1.1 implementation and add it to the app. The JSTL is not part of the JDK nor is it provided by Tomcat.

Apache's implementation can be had here.
 
Stefan Evans
Bartender
Posts: 1782
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm. Bear, the page you linked doesn't appear to have download links that work.

Here are a couple that do:

JSTL1.0: http://archive.apache.org/dist/jakarta/taglibs/standard-1.0/
JSTL1.1: http://archive.apache.org/dist/jakarta/taglibs/standard/
JSTL1.2: ???

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan Evans wrote:Hmm. Bear, the page you linked doesn't appear to have download links that work.

Hmmm, someone at Apache is asleep at the wheel! Thanks for the working links.

 
Flavio Ortellao
Greenhorn
Posts: 6
Eclipse IDE Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've found some jstl jars in an old project...
But it is suspicious that since those links are dead, there's no any "official" provider...
Is it possible that this happens due to be JSTL deprecated or maybe obsolete?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Flavio Ortellao wrote:Is it possible that this happens due to be JSTL deprecated or maybe obsolete?

Ummm, no.
 
Gert-Jan den Besten
Ranch Hand
Posts: 56
Java Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may be a 'dirty hack' but:
If you download Geronimo 2.2.1 from Apache, you'll find a jstl-1.2.jar in the repository/javax/servlet/jstl/1.2 subdirectory. I copied this jarfile into the $CATALINA_HOME/lib directory and a <c:forEach> construct seemed to work fine.
 
Sreenivasa Majji
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSTL libraries comes with Tomcat, just look for the .jar files.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat includes the JSTL 1.1 jars in the examples web app. But not JSTL 1.2 -- at least not yet.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Flavio Ortellao wrote:But it is suspicious that since those links are dead, there's no any "official" provider...

I agree that it's strange. Normally, they'd be available somewhere around here: http://java.net/projects/jstl/, but the whole java.net web site is undergoing a massive reorganization, which currently means that only the source code is available, but no binaries. Eventually, the site will have the binaries, but I don't think a timeline has been announced for that yet. For the moment, downloading GlassFish is your best option (or building from source, which is easy enough if you have SVN and Maven available).
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Normally, they'd be available somewhere around here: http://java.net/projects/jstl/, but the whole java.net web site is undergoing a massive reorganization, which currently means that only the source code is available, but no binaries.

Binaries are now available one again: http://jstl.java.net/download.html
 
Nam Ha Minh
Ranch Hand
Posts: 504
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I downloaded the JSTL 1.2 JAR files (jstl-api-1.2.jar and jstl-impl-1.2.jar). Put them under WEB-INF\lib, however I still get the error message:


The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application


What would be cause of the problem?
 
tyte kyat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I also got the same problem. and add the following file to visualize.

[Edit: link removed due to excess advertising. Please copy and past text, not images or links.]

and also the following is my version info ..

Server info: Apache Tomcat/7.0.26
Servlet version: 3.0
JSP version: 2.1
Java version: 1.7.0_03

I have built my web.xml according to http://www.coderanch.com/how-to/java/ServletsWebXml

thanks in advance...
for those who gonna look and help me solve the problem.
 
tyte kyat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, now I got the problem(the above) sorted ...

all we have to do is just to put the both files (jstl-api and jstl-impl) under lib folder..

Thanks.
 
Nam Ha Minh
Ranch Hand
Posts: 504
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tyte kyat wrote:Hi, now I got the problem(the above) sorted ...

all we have to do is just to put the both files (jstl-api and jstl-impl) under lib folder..

Thanks.


That isn't enough, I have to put some xmlns declaration in the web.xml file:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nam Ha Minh wrote:That isn't enough, I have to put some xmlns declaration in the web.xml file:

Absolutely incorrect. No entries in the web.xml need to be made or should be made. The container will automatically find the TLDs in the jar files deployed in WEB-INF/lib.
 
Nam Ha Minh
Ranch Hand
Posts: 504
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Nam Ha Minh wrote:That isn't enough, I have to put some xmlns declaration in the web.xml file:

Absolutely incorrect. No entries in the web.xml need to be made or should be made. The container will automatically find the TLDs in the jar files deployed in WEB-INF/lib.


No, it's true in my case. Maybe the TLDs are missing so the xmlns is required.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic