How to get rid of "javax.servlet.jsp.PageContext cannot be resolved to type" on jsp page with Eclipse?

I have this weird error on a .jsp page in eclipse:

javax.servlet.jsp.PageContext cannot be resolved to a type 

My project is a maven project , imported into "as an existing maven project , in juno with m2e and m2e-wtp .

Is this a m2e plugin bug? If so, what is the possible workaround to get rid of this error (and the red mark in the workspace explorer)?

Otherwise, do I need to tell maven that my project contains jsp pages? And hopefully the m2e plugin will add the correct library to the classpath. If so, how?

enter image description here

+4
source share
2 answers

After updating to Kepler and updating all the plugins, the problem disappeared. It was probably a mistake.

+1
source

The solution that worked for me is given in this answer . Go to project properties> Target runtimes> Check the box for the runtime (Apache Tomcat 7 in my case).
All this. Just create a project now and everything will be fine.

+8
source

All Articles