Eclipse (Helios) occasionally marks valid looking JSP content as having errors. It seems like it often breaks when I use the
For Tomcat 7.0.x you need the following in your pom
<properties>
<org.apache.tomcat.version>7.0.28</org.apache.tomcat.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
<version>${org.apache.tomcat.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
Solution for eclipse dependencies which should not be deployed is adding UserLibrary container, and include it in dependent projects.
You can do that for all *.jars which should not be deployed, but eclipse need it for validation purpose.
I had the same problem, but both jsp-api.jar and servlet-api.jar were already in build path. Disabling JSP Syntax Validator didn't help as well.
Instead, I had to disable JSP Content Validator, leaving the syntax validator enabled. I still have underlined code in my JSP but no red cross indicating compiling error and that's the point :)
In order to fix:
- javax.servlet.jsp.* needs jsp-api.jar
- javax.servlet.http.* needs servlet-api.jar
You need to add these libraries to Java Build path in project setup. These libraries can be found in tomcat/lib directory (for Tomcat 6.0).
Try to check your project classpath. It looks like you don't have the JSP library in your project (hence the "JspException cannot be resolved"), or that your library version isn't the same as the JSP compiler version.
The library is included by default in the application server on which you deploy your app, so the code runs perfectly when deployed. However, if the Eclipse internal compiler is missing a library (or have an incorrect version), the Eclipse editor shows you error that doesn't exists in app server.
I also see the same problem during I shift to Maven (with m2e), get error like "javax.servlet.http cannot be resolved" and some Spring tags undefined warning. finally I find it's because java version (v1.6) in my build configuration is not same as in facets configuration (v1.7). after change v1.7 to v1.6 the problem disappear.