This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

taglib uri cannot be resolved

 
Boobalan Pillai
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am preparing for SCWCD.When tried to use few jstl tags in my application I am getting the following exception:

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)


This is the steps I followed

1)I put jstl.jar,standard.jar in WEB-INF/lib dir...
2)I put entry in web.xml like
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/lib</taglib-location>
</taglib>

3)In my jsp file looks like this
<%@ page import="test.com.web.Person" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core " %>
<html>
<body>
<c:set target="${Person}" property="firstName" value="Bala"/>
Person's firstName-:${Person.firstName}
</body>
</html>


I am guessing that server doent refering the any tld file in the lib dir...

Where would be the error?

Thanks in advance
Bala.
SCJP1.4
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this
<jsp:useBean id="person" class="test.com.web.Person" />
<c:set target="${person}" property="firstName" value="Bala"/>
Person's firstName-:${person.firstName}
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Boobalan,

1. you don't need the taglib declaration in web.xml
2. Remove the extra space after "core" :
Change <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core " %>
into <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


See here for more:
http://faq.javaranch.com/view?JstlTagLibDefinitions
[ November 07, 2006: Message edited by: Satou kurinosuke ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic