码迷,mamicode.com
首页 > Web开发 > 详细

The method getDispatcherType() is undefined for the type HttpServletRequest

时间:2015-02-27 10:10:52      阅读:461      评论:0      收藏:0      [点我收藏+]

标签:getdispatchertype   httpservletrequest   undefined   

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 occurred at line: [44] in the generated java file: [D:\Tomcat8.0\apache-tomcat-8.0.12\work\Catalina\localhost\studentManage\org\apache\jsp\login_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

Stacktrace:] with root cause
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [44] in the generated java file: [D:\Tomcat8.0\apache-tomcat-8.0.12\work\Catalina\localhost\studentManage\org\apache\jsp\login_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:446)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.dw.filter.EncodingFilter.doFilter(EncodingFilter.java:33)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:534)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2381)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2370)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

从表面报错的来看就是HttpServletRequest没有你的这个方法,我查了下,这个方法在这个类中javax.servlet.ServletRequestWrapper。

但是在该页面上什么都没有,试了老半天还是不知道哪儿出错,最后换了一下tomcat运行,可以了。

原来的tomcat是8.0版本的,换了7的,虽然决解了,但还是不知道为什么,以前的tomcat用了大半年没出过任何的问题。

望大神解释下。


The method getDispatcherType() is undefined for the type HttpServletRequest

标签:getdispatchertype   httpservletrequest   undefined   

原文地址:http://blog.csdn.net/qq_20545159/article/details/43963925

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!