The method getDispatcherType() is undefined for the type HttpServletRequest
程序员文章站
2022-07-15 13:24:11
...
今天遇到一个很奇葩的问题
在启动tomcat的时候出现如下问题。
The method getDispatcherType() is undefined for the type HttpServletRequest。
就是在HttpServletRequest没有定义getDispatcherType方法,我看了在HttpServletRequest里面确实没有getDispatcherType方法。servlet 3.0.1 和servlet 3.1.0都没有
[img]http://dl2.iteye.com/upload/attachment/0104/4577/bd61ba58-cfb0-3640-9b52-2c2190b756df.jpg[/img]
在ServletRequestWrapper里面才有
[img]http://dl2.iteye.com/upload/attachment/0104/4581/7aae5feb-5c99-3b89-afba-410ff03e0292.jpg[/img]
但是出问题的login_jsp.java是这样的
我只能把如下的代码删掉
如果您有好的解决办法,麻烦贴出来。
在启动tomcat的时候出现如下问题。
The method getDispatcherType() is undefined for the type HttpServletRequest。
就是在HttpServletRequest没有定义getDispatcherType方法,我看了在HttpServletRequest里面确实没有getDispatcherType方法。servlet 3.0.1 和servlet 3.1.0都没有
[img]http://dl2.iteye.com/upload/attachment/0104/4577/bd61ba58-cfb0-3640-9b52-2c2190b756df.jpg[/img]
在ServletRequestWrapper里面才有
[img]http://dl2.iteye.com/upload/attachment/0104/4581/7aae5feb-5c99-3b89-afba-410ff03e0292.jpg[/img]
但是出问题的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())
如果您有好的解决办法,麻烦贴出来。
上一篇: dataTables参数名称的更改 Converting parameter names for 1.10
下一篇: Spring Boot vs. Spring MVC vs. Spring: How Do They Compare? Spring, Spring Boot, Spring MVC, there a
推荐阅读
-
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
-
The method setBuiltInZoomControls(boolean) is undefined for the type MapView
-
The method getDispatcherType() is undefined for the type HttpServletRequest
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js
-
The method getJspApplicationContext(ServletContext) is undefined for the type
-
The method getServletContext is undefined for the type HttpServletRequest
-
android开发:The method getSupportFragmentManager() is undefined for the type
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js
-
The method getJspApplicationContext(ServletContext) is undefined for the type Js