This article is participating in the Java Theme Month – Java Debug Notes Event, see the event link for details

Summary of abnormal

Now although the use of JSP friends less, but still some people will encounter such problems.

The following error occurs:

Severe: Servlet service ()for servlet jsp threw 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
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:410)...
Copy the code

My JSP page is imported like this:

My Maven configuration looks like this:

500 error occurred when accessing the page.

The solution

A:

The above problem occurs in the Web project, which is found to be a version problem:

The JSTL 1.0 declaration is:

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

After JSTL1.1, the declaration is:

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

2:

The JSTL package may be missing from your Tomcat, so you need to import the JSTL package in your project lib to resolve the problem. Or import the JSTL version of the package in Tomcat lib.