Eclipse Indigo上的编译错误:javax.servlet.jsp.JspException,javax.servlet.jsp.PageContext无法解析为类型

时间:2012-01-16 11:26:06

标签: eclipse jsp jstl

我在eclipse indigo的jsp中添加以下EL时会遇到以下错误。

<form action="${pageContext.request.contextPath}/user">
...
</form>

但是,应用程序运行正常,没有任何编译错误。我仔细检查了servlet-api 2.5和jst 1.2 jar是否在Eclipse IDE中的类路径中。

如果我删除${pageContext.request.contextPath},则不会显示任何错误。

任何人都可以帮助我摆脱这些错误吗?

1 个答案:

答案 0 :(得分:5)

有人建议add following dependency,这对我有用。

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jsp-api</artifactId>
    <version>2.0</version>
</dependency>