SpringMVC框架出现 405 request method post not supported 的解决方法
在SpringMVC框架中当使用post请求服务,然后请求成功转到一个静态文件,如html,htm等网页时。页面出现405 request method post not supported错误,只要在spring的配置文件中加入下面代码即可:
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/pages/*.html" value="myResourceHandler" />
</map>
</property>
<property name="order" value="100000" />
</bean> <bean id="myResourceHandler" name="myResourceHandler" class="org.springframework.web.servlet.resource.ResourceHttpRequestHandler">
<property name="locations" value="/pages/*.html" />
<property name="supportedMethods">
<list>
<value>GET</value>
<value>HEAD</value>
<value>POST</value>
</list>
</property>
</bean>
SpringMVC框架出现 405 request method post not supported 的解决方法的更多相关文章
- Spring MVC出现POST 400 Bad Request &405 Request method 'GET' not supported
首先描述一下出现错误的情景: 我刚学springmvc,想做一个登录界面的东西.然后试着写了一个controller如下: @RequestMapping(value = "/login&q ...
- There was an unexpected error (type=Method Not Allowed, status=405). Request method 'POST' not supported
背景:点击提交按钮ajax请求接口时,报出错误[ Whitelabel Error Page This application has no explicit mapping for /error, ...
- springMVC出现HTTP Status 405 - Request method 'GET' not supported错误的解决方法
今天在写一个简单的springMVC的表单请求处理时,出现了这个问题.我的form表单用的是post方法提交,并没有使用get方法,出现这个问题时,笔者可谓是一脸懵逼. 这是form表单: 这是对po ...
- HTTP Status 405 - Request method 'GET' not supported?(尚硅谷Restful案例练习关于Delete方法出现的错误)
哈罗大家好,最近在如火如荼的学习java开发----Spring系列框架,当学习到SpringMVC,动手实践RESTFUL案例时,发现了以上报错405,get请求方法没有被支持. 首先第一步,我查看 ...
- 使用SpringMVC时报错HTTP Status 405 - Request method 'GET' not supported
GET方法不支持.我出错的原因在于,在JSP中我希望超链接a以post方式提交,但是这里写js代码时出错. <script type="text/javascript"> ...
- Restful风格,PUT修改功能请求,表单中存在文件报错-HTTP Status 405 - Request method 'POST' not supported
解决方案配置如下 <!-- 配置文件上传解析器 --> <bean id="multipartResolver" class="org.springfr ...
- springmvc访问静态资源出现Request method 'GET' not supported
答案最后.:D 默认的访问的URL都会被DispatcherServlet所拦截. 这里说一下如何配置springmvc访问静态文件. <mvc:default-servlet-handler/ ...
- 常见踩坑案例(二)-Request method 'POST' not supported
一 前言 最近涉及到与前后端的数据对接,按道理来说没一点压力结果被一前端童鞋带坑里去了(不过也是很久没写过这种前后端分离进行联调的事情了,如果是一个人全套弄的话就不会出现下面问题). 二 Reques ...
- Feign发送Get请求时,采用POJO对象传递参数的最终解决方案 Request method 'POST' not supported (附带其余好几个坑)
yml: feign: httpclient: enabled: true properties: #feign feign.httpclient.enabled=true <!-- https ...
随机推荐
- # 2018-2019-20175302实验一《Java开发环境的熟悉》实验报告
2018-2019-20175302实验一<Java开发环境的熟悉>实验报告 实验内容 1.使用JDK编译.运行简单的Java程序: 2.使用Eclipse 编辑.编译.运行.调试Java ...
- python完整课程
python完整课程 python课程概述 python课程大纲 链接:http://www.cnblogs.com/lx63blog/articles/9054294.html 课程结构: 1.安装 ...
- struts2各个功能详解(1)----参数自动封装和类型自动转换
struts2里面的各个功能,现在确实都不清楚,完全属于新学! 通过前面的例子,有时就会疑问,这些jsp中的数据信息是怎么传送给action的?例如: <form action = " ...
- ArgumentOutOfRangeException: 指定的参数已超出有效值的范围。 参数名: site
新装的win10系统,跑原来的asp.net 程序报错,原想着vs2017用iis express,不用配置iis了,貌似不行 在控制面板,程序,开启windows功能 勾选用到的asp.net版本, ...
- OkHttp的get和post请求
OkHttp的get.Post 由于没有看过书籍,不能将理论正确的描述出来,只能根据自己的理解,带大家认识下java开发下的OkHttp的get和post两种请求方式. 依赖的包为:okio-1.15 ...
- 使用Json.net对Json进行遍历
公司使用了一种伪Json, 当value为字符串并且以"@"开头时, 要替换成真实的值, 比如{"name":"@countryName"} ...
- MongoDB、PyMongo数据操作
MongoDB 命令 C:\Program Files\MongoDB\Server\4.0\bin mongo 客户端 mongod 服务端 mongoexport 导出 普通格式,每条记录一行,整 ...
- 常用的三种json软件的使用
从几个角度比较三种软件 1. json操作 2 反解 3 性能 易用性还没有列出. 可以根据个人喜好进行取舍. package json; import com.alibaba.fastjson.JS ...
- VNC 分辨率修改
正确的: vncserver -geometry 1280x1024 错误的: vncserver -geometry 1280*1024
- 记录在Ubuntu 18.04系统中安装Apache, MySQL和PHP环境
虽然我们在Linux VPS.服务器安装WEB环境比较方便,可以选择面板或者一键包,但是有些我们需要深入学习的网友不会选择一键安装,而是会尝试编译安装.这样可以学到一些内在的技术.一般我们较为习惯选择 ...