The method getContextPath() from the type HttpServletRequest refers to the missing type

来源:互联网 发布:做问卷调查赚钱的软件 编辑:程序博客网 时间:2024/04/29 23:30

    由于经常在工作室和住处之间用的是不同电脑,今天将一个项目从工作室电脑拷到宿舍之后,将整个项目部署好之后,在每个JSP页面中的"request.getContextPath()"下方出现了红色的波浪线,提示的错误信息是“The method getContextPath() from the type HttpServletRequest refers to the missing type String”,

    此时,解决方式是:

    1 右击该项目 - Build Path - Configure Build Path , 在 Libraries 选项下,会发现有个出错的jre Libraries,将其Remove掉。

    2 然后右击该项目 - Build Path - Add Library, 选择JRE System Library,选择Workspace defaulr JRE(默认的工作JDK), 然后 Finish 。

    这样,JSP页面中的错误提示就消失了。


本文出自 “11828641” 博客,请务必保留此出处http://11838641.blog.51cto.com/11828641/1900389

0 0