In applications, you will get the below error  when you use JSTL along with maven and spring applications:

Error Info:

HTTP Status 500 –  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

message /index.jsp (line: 1, column: 1) 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

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:42)
 org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:276) 
 org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:92)

Possible Root Causes and Solution:

  1. You may be using wrong JSTL version. JSTL 1.2 supports for Servlet 3.0 and JSTL 1.0 supports for Servlet 2.0 containers. so update the maven dependency to 1.2
    1. <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>jstl</artifactId>
          <version>1.2</version>
      </dependency>
  2.  Update the tag lib to below URI as you may be using: http://java.sun.com/jstl/core”
    1. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  3. If you deploy war file, it will work fine but not in eclipse. In this case, change the Dynamic Web Module version to 3.1 as older versions creates web.xml template that support servlet 2.0 onlyApache JSTL error

Leave a Comment

Your email address will not be published. Required fields are marked *