Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JSTL

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

i am having problem with the following code snippet.



it saying org.apache.talibs.standard.tag.rt.core doesn't exist.

i have no idea where the problem lies


i downloaded the two JAR files
1) standard.jar
2) jstl.jar
and put this file in the "\WebRoot\WEB-INF\lib" of my Project.


My Tomcat version is 5.5

can any body please give me some suggestions...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of the JSTL did you download?
 
Prasad Babu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Parameswaran,

try by changing your taglib directive with following

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

Hope this will help you.
 
Stefan Evans
Bartender
Posts: 1721
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
><%@ taglib uri="http://java.sun.com/jsp/jstl/core_rt" prefix="c" %>
No don't do that.
In fact that uri doesn't match any of the valid uris for JSTL.
JSTL1.0 : http://java.sun.com/jstl/core
JSTL1.0-rt: http://java.sun.com/jstl/core_rt
JSTL1.1 : http://java.sun.com/jsp/jstl/core

The "rt" versions of the JSTL should only be used if
- you have a JSP1.2 container
- you want to use runtime expressions with JSTL tags: ie <%= expr %> rather than ${expr}

Seeing as you have Tomcat5.5, you should be using JSTL1.1
Make sure that you don't have jstl.jar and standard.jar more than once in the classpath: check [TOMCAT]/common/lib and [TOMCAT]/shared/lib to see if they were already there.
 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Stefan
i checked with the library folder in "Tomcat 5.5\common\lib" its the only folder having the standard.jar and jstl.jar files

i downloaded JSTL1.1 and also using servlet 2.4 and JSP2.0

after using the URI "http://java.sun.com/jsp/jstl/core" its saying cannot be resolved the uri "http://java.sun.com/jsp/jstl/core" either in web.xml or in the jar file deployed.

To my knowledge including the two jar files in library folder will help to work out in standard Tags. did i need to do any changes in web.xml

please help me out.....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did i need to do any changes in web.xml


No. Placing the jar files in WEB-INF/lib should be enough.

To be sure that you have the right jar files, open standard.jar and find file META-INF/c.tld. Open that file and make sure that the URI matches the one you are specifying.
 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i checked with the standard.jar file the url used is the one which i was using still it throws the error saysing cannot find the package
org.apache.taglibs.standard.tag.rt.core but it exists in the standard.jar

i placed the two jar files inside "projectcontextroot\WebRoot\WEB-INF\lib"
folder.

This is my JSP code. the problem exists in line 4 and line 6.
Line 4--> Package not found as i explained above
Line 6--> unterminated &<c ut tag.

Line 1: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Line 2: <html>
Line 3: <body>
Line 4: <c ut value="cout">
Line 5: </body>
Line 6: </html>


Tag description inside the \standard jar\META-INF\c.tld

URI description



Tag description





The class file "org.apache.taglibs.standard.tag.rt.core.OutTag" exists there inside the standard jar which is inside the web-inf/lib folder of my application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic