码迷,mamicode.com
首页 > 移动开发 > 详细

web app 接收put的配置方式

时间:2018-03-05 12:01:50      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:web app 接收put的配置方式

HiddenHttpMethodFilter/HttpPutFormContentFilter


HiddenHttpMethodFilter:HiddenHttpMethodFilter必须作用于dispatcher前

	<filter>    
		  <filter-name>HiddenHttpMethodFilter</filter-name>    
		  <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>    
	</filter>    
	<filter-mapping>    
		  <filter-name>HiddenHttpMethodFilter</filter-name>    
		  <servlet-name>spring</servlet-name>    
	</filter-mapping>  
	<servlet>  
		<servlet-name>spring</servlet-name>  
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>  
		<init-param>  
			<param-name>contextConfigLocation</param-name>  
			<param-value>classpath:dispatcher.xml</param-value>  
		</init-param>  
	</servlet>  
	<servlet-mapping>  
		<servlet-name>spring</servlet-name>  
		<url-pattern>*.html</url-pattern>  
	</servlet-mapping>
<form action="..." method="post">  
        <input type="hidden" name="_method" value="put" />  
        ......  
</form>


HttpPutFormContentFilter:

<filter>  
    <filter-name>httpPutFormcontentFilter</filter-name>  
    <filter-class>org.springframework.web.filter.HttpPutFormContentFilter</filter-class>  
</filter>  
<filter-mapping>  
    <filter-name>httpPutFormContentFilter</filter-name>  
    <url-pattern>/*</url-pattern>  
</filter-mapping>
<form action="" method="put" enctype="application/x-www-form-urlencoded">  
......  
</form>


web app 接收put的配置方式

标签:web app 接收put的配置方式

原文地址:http://blog.51cto.com/xinzhilian/2082973

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!