The method getContextPath() from the type HttpServletRequest

在做java项目开发的时候,jsp页面很容易报出这个错误。

错误的原因很多,但是都和JRE有关。

一般在导入项目的时候容易报出这个错误,主要因为JRE(jdk版本不一致)。

解决方法:就是重新配置路径,配置你机器上安装的jdk。

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

2.然后右击该项目 → Build Path → Add Library, 选择JRE System Library,选择Workspace defaulr JRE(jdk1.6)(此前JDK已成功安装并配置好), 然后 Finish

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

时间: 2024-08-05 15:00:03

The method getContextPath() from the type HttpServletRequest的相关文章

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

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

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

运行程序报错 提示如下:The method getContextPath() from the type HttpServletRequest refers to the missing type 解决方法: 1 右击该项目 - Build Path - Configure Build Path , 在 Libraries 选项下,会发现有个出错的jre Libraries,将其Remove掉. 2 然后右击该项目 - Build Path - Add Library, 选择JRE Syste

Tomcat6服务端工程部署Tomcat8遇到的 “The method getDispatcherType() is undefined for the type HttpServletRequest” 问题

一个安卓服务端程序起初部署在Tomcat6.0当中,但是当我用Tomcat8.0部署时,出现了一个错误: org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [52] in the generated java file: [D:\apache-tomcat-8.0.15\work\Catalina\localhost\allRunServer\org\apa

The method getDispatcherType() is undefined for the type HttpServletRequest 升级到tomcat8(转)

配置项目,从tomcat低版本,放到tomcat8时,正常的项目居然报错了: The method getDispatcherType() is undefined for the type HttpServletRequest 从网上查资料,找可能出现这个问题的因素: 1可能是环境变量,检查了没问题 2有人说jar包冲突 对于servlet-api.jar这个包,原来工程中有,在旧的tomcat版本中,如果不加,会出问题,新的版本中加了会有问题,删除这个包,重启,ok http://blog.

The method getDispatcherType() is undefined for the type HttpServletRequest

web项目访问时就报错,新建的一个jsp文件里面没有任何的内容也报错,错误:The method getDispatcherType() is undefined for the type HttpServletRequest 严重: Servlet.service() for servlet [jsp] in context with path [/studentManage] threw exception [Unable to compile class for JSP: An error

日常问题记录--访问JSP文件时The method getDispatcherType() is undefined for the type HttpServletRequest

问题现象: 访问任一jsp(即使是空白文件)文件报The method getDispatcherType() is undefined for the type HttpServletRequest错误. 定位: 根据错误提示,查询到getDispatcher位于servlet-api.jar包中. 反编译tomcat/webapp/proj/lib中的servelt-api.jar,发现确实没有这个方法: 问题解决: 清理这个包,删除之,并升级到最新的servelt-api包.解决:

Bean property 'esyerDao' is not writable or has an invalid setter method. Does the parameter type of

今天调试程序的时候偶然出现了 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeServiceDest' defined in ServletContext resource [/WEB-INF/web-application-config.xml]: Error setting property values; nested exception is o

eclise -The method onClick(View) of type new View.OnClickListener(){} must override a superclass method

在做arcgis android开发的时候,突然遇到这种错误,The method onClick(View) of type new View.OnClickListener(){} must override a superclass method. 这看起来确实很奇怪,网上搜了一下,解决方案是将 eclipse制定版本从1.7改为1.6即可. 在 eclipse中,windows->references->java->java compiler中设置.

instance method '*****' not found (return type defaults to 'id')

博文转载至 http://blog.csdn.net/cerastes/article/details/38025801 return type defaultsnot foundiOSwarning 在一个类里面引用另外一个类的实例方法,警告方法没有找到. 原因.h文件没有应用,只在头文件中申明了@class #import相应的.h文件就可以 instance method '*****' not found (return type defaults to 'id')