Solved

JSTL use with a jsp

Posted on 2012-04-05
11
976 Views
Last Modified: 2012-04-09
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>  <
      head>    
            <title>Count to 10 Example (using JSTL)</title>  
      </head>  

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

</html>

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

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

or

Tomcat 5.0\common\lib

I have jdk version j2sdk1.4.2_01.

Thank you
JSTL-ISP-Error.txt
0
Comment
Question by:Mike Eghtebas
  • 7
  • 4
11 Comments
 
LVL 27

Expert Comment

by:rrz
ID: 37814719
I just realized that Tomcat 5 is too old for JSTL 1.2.
I think you need to go to  
http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/ 
and download  
jakarta-taglibs-standard-1.1.2.zip  
Unzip it and look in the folder
jakarta-taglibs-standard-1.1.2/lib  
and you will find two jars;  
jstl.jar and  standard.jar  
Put those two jars into  
Tomcat 5.0\common\lib
0
 
LVL 27

Expert Comment

by:rrz
ID: 37814771
Why don't you use Tomcat 7 ?
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 37814906
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)?

Thanks
0
 
LVL 27

Expert Comment

by:rrz
ID: 37814997
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.
0
 
LVL 27

Expert Comment

by:rrz
ID: 37815012
Go ahead and get the older jars. See My first comment.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 27

Expert Comment

by:rrz
ID: 37815023
>Does it get uncompressed automatically?
No. java just reads it.  
>It is supposed to list 1 to 10 (in 10 lines)?  
yes
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 37816118
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.


Thanks
coomon-lib-folder.bmp
0
 
LVL 27

Expert Comment

by:rrz
ID: 37816286
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.
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 37816380
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).

Mike
JSTL-ISP-Error2.txt
0
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
ID: 37816425
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
jstl-1.2.jar  
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" %>
0
 
LVL 33

Author Closing Comment

by:Mike Eghtebas
ID: 37823747
thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Running Java Servlet inside Eclipse Luna 6 147
Can I clean log of  running tomcat 7 server ? 3 125
Stuck in Bootstrap WysiHtml Editor 3 37
reflections, dynamic class loading 3 66
When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now