• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1017
  • Last Modified:

JSTL use with a jsp

When I run the following jsp, I am getting the error in the attached txt file.

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<html>  <
            <title>Count to 10 Example (using JSTL)</title>  

            <c:forEach var="i" begin="1" end="10" step="1">      
            <c:out value="${i}" />      
            <br />    


Do I need to have jstl-1.2.jar in:

Tomcat 5.0\webapps\ROOT\WEB-INF\lib\


Tomcat 5.0\common\lib

I have jdk version j2sdk1.4.2_01.

Thank you
Mike Eghtebas
Mike Eghtebas
  • 7
  • 4
1 Solution
I just realized that Tomcat 5 is too old for JSTL 1.2.
I think you need to go to  
and download  
Unzip it and look in the folder
and you will find two jars;  
jstl.jar and  standard.jar  
Put those two jars into  
Tomcat 5.0\common\lib
Why don't you use Tomcat 7 ?
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
In my own laptop I have 7.0 but at work, I have to use version 5.

any idea what the error is complaining about? I did put jstl-1.2.jar in common\lib folder.

Does it get uncompressed automatically? Does the error has something to do with the this version of jstl (jstl-1.2.jar in)?

Why the above jsp not working? It is supposed to list 1 to 10 (in 10 lines)?

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

I forgot to tell you that  
><%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>  
Was for JSTL 1.0  
For JSTL 1.1 and greater,  we have to use  
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

>any idea what the error is complaining about?  
>java.lang.UnsupportedClassVersionError: org/apache/taglibs/standard/tlv/JstlCoreTLV (Unsupported major.minor version 49.0)
This error is given because the new features introduced in the newer version of Java are not present in the older version.
Go ahead and get the older jars. See My first comment.
>Does it get uncompressed automatically?
No. java just reads it.  
>It is supposed to list 1 to 10 (in 10 lines)?  
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
In common\lib folder, I have 73 files. This means I possibly have all I need and it is not required to download something else.

How can I what version of JSTL I have so that we can modify the directive (<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>) accordingly?

Please see the attached screen-sholt of the files in this folder.

What did you download ?  
Anyway, just use  
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    

>How can I what version of JSTL I have  
You could make a copy of it and change the file name to xxx.zip. Unzip it and look in  the META-INF/MANIFEST.MF file.
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
re:> What did you download ?

I have not dowloaded yet because I had 73 files in common\lib folder thinking I have already what I need. So the question is how to modify the directive (in the book example:<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>) to work with what I already have.

I did try:

<%-- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

but got the attached error (maybe the same as before).

I am sorry.  I didn't think there was going to be a  problem.
Now I notice in  your common-lib-folder.bmp that you have both versions in there.  
Please remove
You can't use that in Tomcat 5 and it might be causing the problem.  
You have the jstl.jar and standard.jar already in there. Good.  You can check the version in the manifest(in jstl.jar) as I posted above here. If its 1.1x then use
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now