1

I had a problem with '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'.

My project worked well in the morning and I faced this problem near evening on the same day. Some of my jsp pages have no problem to load but some of them displayed 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:445)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:325)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:154)
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:1410)
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:199)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

I have same taglib for every of my jsp which is:

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

and my web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

By the way, I don't have pom.xml in my project.

What could possibly go wrong in such a short time? What can I do to solve this? I had sit in front of my computer for hours to find a solution. Please help me. :(

Tomcat version - 7.0.56

jstl-1.2

Sue
  • 125
  • 1
  • 2
  • 14

2 Answers2

1

I have solved it by replacing jstl-1.2 to javax.servlet.jsp.jstl-api-1.2.1 (the API) and javax.servlet.jsp.jstl-1.2.1.jar (the impl) as shown in https://stackoverflow.com/tags/jstl/info. Both jar files are available to download there.

Remember to refresh and clean your project after the new jar files are copied into your WEB-INF/lib.

Community
  • 1
  • 1
Sue
  • 125
  • 1
  • 2
  • 14
0

While working on Eclipse although I have added jar files in the build path ( class path) but I forgot to add in Web-INF/lib. So do not do this mistake.

Also, refresh the project so that to load the newly added jars.

Dharman
  • 30,962
  • 25
  • 85
  • 135