I'm getting two very odd errors when opening a project. If I open the landing page and keep refreshing it, the error messages alternate between the two below.
Either I get this:
org.apache.jasper.JasperException: /WEB-INF/pages/LandingPage.jsp (line: 2, column: 0) The absolute uri: http://www.springframework.org/security/tags cannot be resolved in either web.xml or the jar files deployed with this application
Or this:
HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.pages.LandingPage_jsp
What on earth is happening?
Because:
Cause 1: Parsing JSP file error. For example: Error JSP page (due syntax error or missing dependencies):
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page session="false" %>
<html>
<head>
<title>Home</title>
</head>
<body>
<h1>Hello world!</h1>
<p>The time on server is ${serverTime}.</p>
</body>
</html>
Make it correct:
<%@page session="false" %>
<html>
<head>
<title>Home</title>
</head>
<body>
<h1>Hello world!</h1>
<p>The time on server is ${serverTime}.</p>
</body>
</html>
Cause 2: missing dependencies. Fix it by add these dependencies:
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
You must set scope
like the above.
In my case, AOP was reporting that I could speed up tomcat and webapp start time by adding jars to the catalina.properties section "tomcat.util.scan.StandardJarScanFilter.jarsToSkip", including jstl-1.2.jar.
Don't listen to this advice; only sadness will come of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With