Eclipse (Helios) occasionally marks valid looking JSP content as having errors. It seems like it often breaks when I use the <c:if> tag. For example, in a JSP with just this content:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <html> <body> <c:if test="${1 == 1}"> something </c:if> </body> </html>
The following errors show in the "Problems" tab after I compile:
The code runs fine. Does the validation for JSPs have issues, am I missing something obvious, or does this indicate something isn't set up correctly.
Well, I found how to solve this error. Add this to your Maven dependency(pom.xml):
<!-- dependency to fix JSPServletException --> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>jsp-api</artifactId> <version>6.0.32</version> <scope>provided</scope> </dependency>
Do comment if you find it useful, as much as it helped me.
Based on the comments, I ended up turning off part of the JSP validation, which fixed this.
I was hoping I was missing something and there was a way to fix this, but I have to concede that the JSP validation is junk.
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