<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>