wood burning stoves*
The moose likes JSP and the fly likes Cannot import Taglib JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Cannot import Taglib JSTL" Watch "Cannot import Taglib JSTL" New topic
Author

Cannot import Taglib JSTL

Flavio Ortellao
Greenhorn

Joined: Feb 01, 2011
Posts: 6

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

Joined: Jan 10, 2002
Posts: 61095
    
  66

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
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

Joined: Jan 10, 2002
Posts: 61095
    
  66

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

Joined: Feb 01, 2011
Posts: 6

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

Joined: Jan 10, 2002
Posts: 61095
    
  66

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

Joined: May 02, 2008
Posts: 56

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.

SCJP 5; SCJD; SCWCD 5.
Sreenivasa Majji
Ranch Hand

Joined: Jul 12, 2001
Posts: 224
JSTL libraries comes with Tomcat, just look for the .jar files.


Sreenivasa Majji
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

Tomcat includes the JSTL 1.1 jars in the examples web app. But not JSTL 1.2 -- at least not yet.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41601
    
  55
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).


Ping & DNS - my free Android networking tools app
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41601
    
  55
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

Joined: Oct 31, 2011
Posts: 498

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?


PM Me If You Want to get Urgent Help on Java Programming
tyte kyat
Ranch Hand

Joined: May 17, 2011
Posts: 40
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

Joined: May 17, 2011
Posts: 40
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

Joined: Oct 31, 2011
Posts: 498

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

Joined: Jan 10, 2002
Posts: 61095
    
  66

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

Joined: Oct 31, 2011
Posts: 498

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot import Taglib JSTL