Spring表單。我想通過改變其領域status.some形式來控制。我想提交表單控制器,以接取的值更新由客戶提出的要求
h2>Update Request</h2>
>form:form method="POST" action="/my/update.htm" commandName="servicehistory">
table align="center" border="0">
<tr><td>Request Id: </td>
<td><form:input path="sr.ServiceRequestId" value="${sr.serviceRequestId}"></form:input> < other fields..............
<tr><td><input type="submit" value="Save" /></td></tr>
控制器訪問表單值並更新數據庫中的請求,但沒有發生.GUI顯示資源不可用。它沒有使用Spring Security。
@RequestMapping(value="/my/update.htm",method=RequestMethod.POST)
public ModelAndView update(@ModelAttribute("servicehistory") @Valid ServiceHistories sh1,BindingResult result,ModelMap map)
{
Redirect it to another page after validating the form
return new ModelAndView(("redirect:/displaylist.htm"));
}
>Spring Security which implement security after matching url and user role
< HTTP自動配置= 「真正的」 使用表達式= 「真」>
<intercept-url pattern="/admin/*" access="hasRole('Technician')" />
<intercept-url pattern="/my/**" access="hasRole('Techincian')" />
HREF = 「/我/ edit.htm?ServiceRequestId = $ {history.serviceRequestId}」>編輯/刪除 –
請告訴我正確的模式,將在上述情況下工作 –