Samuel Rossille
Samuel Rossille

Reputation: 19828

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

I have this weird error in 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" into juno with m2e and m2e-wtp plugins installed.

Is this a bug of the m2e plugins ? If yes, what's a possible workaround to get rid of this error (and the red mark in the workspace explorer) ?

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

enter image description here

Upvotes: 4

Views: 13821

Answers (2)

Nav
Nav

Reputation: 20648

The solution that worked for me, is given in this answer. Go to project properties > Targeted runtimes > Select the checkbox for a runtime (Apache Tomcat 7 in my case).
That's all. Just build the project now and everything will be fine.

Upvotes: 8

Samuel Rossille
Samuel Rossille

Reputation: 19828

After upgrading to Kepler and updating all plugins, the issue disapeared. It was probably a bug.

Upvotes: 1

Related Questions