尝试了好几种方式,找到了一种能用的
一、在web.xml文件中创建HiddenHttpMethodFilter过滤器
<filter>
<filter-name>hiddenHttpMethodFilter</filter-name>
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>hiddenHttpMethodFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
二、ajax实现put请求
$.ajax({
url:'${pageContextScope.request.contextPath}/emp&_method=PUT',
type:'POST',
data:$('editorForm').serialize(),
success:function(data){
}
})