本文主要是介绍过滤器无意间出错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
重装了MyEclipse6.0.1之后、打开原来的工程目录、在启动Tomcat6.0的时候总是出现莫名其妙的提示:
javax.servlet.Filter 无法编译
重新引入J2EE包也不行、最后没有办法、重写了一个过滤器、但里面完全跟原来的过滤器一模一样、在web.xml引入新的过滤器之后就不会再提示错误了。
不知道怎么回事、删除原来的过滤器、但想把这些错误的信息记录下来、撤销删除操作、在web.xml中引入原来的过滤器、这时这个类又恢复正常了。。。。。。
严重: Servlet.service() for servlet action threw exception
java.lang.Error: Unresolved compilation problems:
The import javax.servlet.http.HttpServletRequest cannot be resolved
The import javax.servlet.http.HttpServletResponse cannot be resolved
The import javax.servlet.http.HttpSession cannot be resolved
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpSession cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpSession cannot be resolved to a type
at com.lt.hr.action.LoginAction.<init>(LoginAction.java:7)
java.lang.Error: Unresolved compilation problems:
The import javax.servlet.http.HttpServletRequest cannot be resolved
The import javax.servlet.http.HttpServletResponse cannot be resolved
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
com.lt.cage.action.JunketPromoterAction.<init>(JunketPromoterAction.java:11)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:506)
java.lang.Class.newInstance0(Class.java:355)
java.lang.Class.newInstance(Class.java:308)
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)
org.apache.struts.action.RequestProcessor.processActionCreate(RequestProcessor.java:292)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:230)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.lt.cage.filters.EncodingFilter.doFilter(EncodingFilter.java:23)
这篇关于过滤器无意间出错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!