我把项目从myeclipse导入到eclipse j2ee中。已经导入了,运行后出现下面错误:
java.lang.Error: Unresolved compilation problems:
The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from required .class files
The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly referenced from required .class files
The import javax.servlet.http.HttpServletRequest cannot be resolved
The import javax.servlet.http.HttpServletResponse cannot be resolved
The type MySuperAction must implement the inherited abstract method ServletResponseAware.setServletResponse(HttpServletResponse)
The type MySuperAction must implement the inherited abstract method ServletRequestAware.setServletRequest(HttpServletRequest)
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
是不是struts2包的问题?
但我已经导入struts2包啊
在myeclipse6.5运行是没问题的,请高手指点,谢谢!!
------解决思路----------------------
servlet-api对应的jar包有没有?
------解决思路----------------------
包的路径是不是也有问题
------解决思路----------------------
项目属性中 》Java Build Path 里面添加 "Add ..." > Library > Server Runtime 添加一下你将要运行的服务器环境进去。