`
wujierd
  • 浏览: 45684 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

The method getDispatcherType() is undefined for the type HttpServletRequest

 
阅读更多
今天遇到一个很奇葩的问题
在启动tomcat的时候出现如下问题。
The method getDispatcherType() is undefined for the type HttpServletRequest。
就是在HttpServletRequest没有定义getDispatcherType方法,我看了在HttpServletRequest里面确实没有getDispatcherType方法。servlet 3.0.1 和servlet 3.1.0都没有



在ServletRequestWrapper里面才有




但是出问题的login_jsp.java是这样的
  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

final java.lang.String _jspx_method = request.getMethod();
if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
return;
}

我只能把如下的代码删掉
&& !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())


如果您有好的解决办法,麻烦贴出来。
  • 大小: 50.1 KB
  • 大小: 49.9 KB
分享到:
评论

相关推荐

    JSP访问时出错

    安装了jdk1.8版本或tomcat8.0版本后运行之前jsp项目报错:org.apache.jasper.JasperException: Unable to compile class for JSP: ...The method getDispatcherType() is undefined for the type HttpServletRequest

    servlet2.4doc

    The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. doGet...

    httpservletrequest的jar包

    httpservletrequest、httpsession的jar包,导入资源包。

    从HttpServletRequest获取各种路径总结

    从HttpServletRequest获取各种路径总结.docx从HttpServletRequest获取各种路径总结.docx

    httpservletRequest的学习笔记

    httpservletRequest的学习笔记

    外文翻译 stus MVC

    The purpose of Action class is to translate the HttpServletRequest to the business logic. To use Action, subclass and overwrite the process() method. The ActionServlet (Command) passes the ...

    HttpServletRequest解析设备类型和浏览器类型

    分析HttpServletRequest 内容 解析出设备来源 手机 电脑 什么种类浏览器 什么系统

    基于JAVa的网上商城项目完整源码.zip

    * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @...

    HttpServletRequest和HttpServletResponse的必备包

    Java中,引入javax.servlet.http.HttpServletRequest和javax.servlet.http.HttpServletResponse包的必备jar包:org.apache.commons.httpclient.jar

    java一个论坛的源码

    * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @...

    网上书城 购物系统 jsp

    * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @...

    tomcat10升级单个jar里面的jakarta.servlet.http.HttpServletRequest

    入参的HttpServletRequest必须为:import jakarta.servlet.http.HttpServletRequest; 运行cmd,再该目录下执行: 执行步骤:java -jar jakartaee-migration-1.0.1.jar commons-fileupload-1.4.jar commons-...

    购物网站系统

    * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @...

    Servelt技术做的E家园

    * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request * the request send by the client to the server ...

    医院管理系统.rar

    * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @...

    实践考核类课二 选课系统

    * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to ...

    网上购物系统

    * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param ...

    c3p0工具包(jdbc)

    * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing ...

    验证码(网页中用到的)

    * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @...

    HttpServletRequest 中 getRequestURL和getRequestURI的区别

    HttpServletRequest 中 getRequestURL和getRequestURI的区别文档

Global site tag (gtag.js) - Google Analytics