今天遇到一个很奇葩的问题
在启动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
分享到:
相关推荐
安装了jdk1.8版本或tomcat8.0版本后运行之前jsp项目报错:org.apache.jasper.JasperException: Unable to compile class for JSP: ...The method getDispatcherType() is undefined for the type HttpServletRequest
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、httpsession的jar包,导入资源包。
从HttpServletRequest获取各种路径总结.docx从HttpServletRequest获取各种路径总结.docx
httpservletRequest的学习笔记
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 内容 解析出设备来源 手机 电脑 什么种类浏览器 什么系统
* 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 * @...
Java中,引入javax.servlet.http.HttpServletRequest和javax.servlet.http.HttpServletResponse包的必备jar包:org.apache.commons.httpclient.jar
* 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 * @...
* 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必须为: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 * @...
* 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 ...
* 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 ...
* 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的区别文档