Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page 434 JSTL

 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

Actually I copied jstl.jar and placed in wen-inf/lib. after that I tried to run this code.

<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
Movie list
<c:forEach var = "movie" items = $ {movieList}">
${movie}
</c:forEach>
</body>
</html>

am geting this error

org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:60)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:385)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:109)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:116)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:309)


my jstl.jar path is

C:\Documents and Settings\Administrator\My Documents\eclipse\workspace\TomcatProject\WEB-INF\lib\jstl.jar

just I copied jstl.jar into this folder. do I need to unzip it?

can you please solve my pb?
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
copy standard.jar also.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://faq.javaranch.com/view?JstlTagLibDefinitions
 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

I have copied both the jar files... again am geting the same error.

do I need to do some changes in web.xml?

please help me
 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made it... Yes I did some change in web.xml
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/lib/jstl.jar</taglib-location>
</taglib>
But am geting diff error in my console like this

error:
Exception initializing TldLocationsCache: zip file closed

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html><body>
<strong> Movie List: </strong>
<% String movieList= "Lion King"; %>
<table>
${movieList}
</table>
</body></html>

the O/P shows like this...not printing the value...

Movie List:
${movieList}

do i need to unzip both the .jar files... please help me...guys
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
explicitly enable the EL and the retry

also in your frst post you were using the c:forEach, but in your second post you havent used it anywhere.

?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic