Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am using JDK 1.7, Apache Tomcat 7.0.23 and I have placed JSTL core library(1.2) and STANDARD jar in WEB_INF lib folder it is not giving me any warning but when I will try to run the code

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- Create Bean Instance--> <jsp:useBean id="listdomain" class="bean.PopulateMultiDomain" scope="session"></jsp:useBean>  <jsp:setProperty property="*" name="listdomain"/>  <c:forEach var="item" items="${listdomain.status}">     <option>         <c:out value="${item}" />     </option> </c:forEach>  

it gives me the following error:

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:56)     org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:410)     org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)     org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:311)     org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152)     org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)     org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)     org.apache.jasper.compiler.Parser.parseElements(Parser.java:1425)     org.apache.jasper.compiler.Parser.parse(Parser.java:138)     org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)     org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)     org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)     org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)     org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)     org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)     javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 

Can anyone suggest me what mistake I am making?

like image 619
Nishit Jain Avatar asked Jan 02 '12 13:01

Nishit Jain


2 Answers

Remove the standard.jar. It's apparently of old JSTL 1.0 version when the TLD URIs were without the /jsp path. With JSTL 1.2 as available here you don't need a standard.jar at all. Just the jstl-1.2.jar in /WEB-INF/lib is sufficient.

See also:

  • How to install JSTL? The absolute uri: http://java.sun.com/jstl/core cannot be resolved
  • Our JSTL wiki page
like image 131
BalusC Avatar answered Oct 05 '22 18:10

BalusC


I solved the same problem. I've just added JSTL-1.2.jar to /apache-tomcat-x.x.x/lib and set scope to provided in maven pom.xml:

 <dependency>      <groupId>jstl</groupId>      <artifactId>jstl</artifactId>      <version>1.2</version>      <scope>provided</scope>  </dependency> 
like image 42
Yauhen Avatar answered Oct 05 '22 17:10

Yauhen