今天遇到一个很奇葩的问题
在启动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())
如果您有好的解决办法,麻烦贴出来。