错误"HttpServletRequest引用缺少的类型字符串"

Yug*_*gal 16 java jsp servlets struts2

我正在struts中实现一个项目,我在JSP页面中收到错误.

我已经在Eclipce IDE中配置了Tomcat 6,JRE和JDK 6.

代码是:

%request.getContextPath()%
Run Code Online (Sandbox Code Playgroud)

错误是:

The method getContextPath() from the type HttpServletRequest refers to the missing type String
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?

Boz*_*zho 31

您尚未将JRE库添加到IDE中.添加它.


小智 8

单击您的项目并转到构建路径配置更新的jre路径并选择要添加的库类型