如何将post请求转换成put和delete请求

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

<br>

<c:if test="${employee.id == null }">

<!-- path 属性对应 html 表单标签的 name 属性值 -->

LastName: <form:input path="lastName"/>

<form:errors path="lastName">

</form:errors>

</c:if>

<c:if test="${employee.id != null }">

<form:hidden path="id"/>

<!-- 将POST请求转化为PUT请求 -->

<input type="hidden" name="_method" value="PUT"/>

</c:if>

<br>

Email: <form:input path="email"/>

<input type="submit" value="Submit"/>

</form:form>

posted @ 2018-02-27 17:18  逆水乘舟,不进则退  阅读(1543)  评论(0编辑  收藏  举报