Spring MVC HTTP Status 405 - Request method 'PUT' not supported type Status report message Request

HTTP Status 405 - Request method 'PUT' not supported


type Status report

message Request method 'PUT' not supported

description The specified HTTP method is not allowed for the requested resource.


Apache Tomcat/7.0.78



问题已经找到了.
在页面中   表单中要使用 ${pageContext.request.contextPath }
之前没有加  ${pageContext.request.contextPath } ,导致的错误,,

<form:form action="${pageContext.request.contextPath }/emp" 
method="POST" modelAttribute="employee">

因为用到了rest风格的路径不过项目中建议用绝对路径.

你可能感兴趣的:(Spring MVC HTTP Status 405 - Request method 'PUT' not supported type Status report message Request)