Eclipse (Helios) occasionally marks valid looking JSP content as having errors. It seems like it often breaks when I use the
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.
You need to include jap-api.jar in your classpath.
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.
A much easier way is to
select the project -> Properties -> Java Build Path -> Libraries Tab
Select add Libraries
. From there select Server Runtime
. It will list all the server runtimes you have configured. From there Select the server runtime you have assosiated your project with.
This will rebuild and revalidate the projece and all this ghost errors will be removed.
Hope this helps.
I had the same problem and eventually got it to work by switching (with Maven) to version 2.3 of the servlet-api:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.3</version>
<scope>provided</scope>
</dependency>
Apparently 2.4 and higher don't have javax.servlet.jsp build in anymore. You might be able to find that library in another package if you still want to use 2.4 or higher.
Adding jsp-api.jar
into your build classpath would fix it. jsp-api.jar
is under common\lib
for tomcat 5.x