aspose file tools*
The moose likes JSP and the fly likes Problem with JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with JSTL" Watch "Problem with JSTL" New topic
Author

Problem with JSTL

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
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

Joined: Jan 10, 2002
Posts: 61224
    
  66

What version of the JSTL did you download?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Prasad Babu
Ranch Hand

Joined: Jul 17, 2005
Posts: 57
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

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

Joined: Mar 01, 2005
Posts: 485
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

Joined: Jan 10, 2002
Posts: 61224
    
  66

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

Joined: Mar 01, 2005
Posts: 485
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with JSTL