The import javax.servlet.http.HttpServletRequest cannot be resolved

来源:互联网 发布:桌面壁纸软件哪个好 编辑:程序博客网 时间:2024/05/22 03:02

Error creating bean with name 'userLogger' defined in class path resource [applicationContext-core.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [dersp.core.utils.UserLogger]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 

The import javax.servlet.http.HttpServletRequest cannot be resolved

HttpServletRequest cannot be resolved to a type

The method getRequest() from the type ServletActionContext refers to the missing type HttpServletRequest

解决方法:

在找到项目源文件的/WebRoot/WEB-INF/lib下增加一个servlet-api的札包,到eclipserefresh整个项目,然后右击项目名,选择buildpath->config build path ->add jars

servlet-api札包下载地址:http://download.csdn.net/detail/tongyuehong/6416979

 

 

原创粉丝点击