我有一个显示信息的表单,Web用户可以输入一些参数以在服务器上启动查询。
此外,网络用户可以创建一个新用户,因此我可以使用另一种形式。
要显示网页
@RequestMapping(method = RequestMethod.GET, value = "/secure/admin/csvUser")
public String csvUserView(Model model, Locale locale) {
model.addAttribute("userBeanList", userBeanMap);
model.addAttribute("addUserBean", new UserBean());
return VIEW_CSV_USER;
}
在我的网页上
<c:url var="downloadUsertUrl" value="/secure/downloadcsvUser/" />
<c:url var="deleteUserUrl" value="/secure/deleteUser/" />
<c:url var="addUserUrl" value="/secure/addUser/" />
使用此代码显示UserBeanList
<form id="formUser" action="${downloadUserUrl}">
<c:forEach var="userBeans" items="${userBeanList}" varStatus="statusUser">
<tr data-username="${userBeans.key}">
<td>${statusUser.count}</td>
<td>${userBeans.value.userTitle}</td>
<td align="center">
<button type="button" id="updateUserButton${statusUser.count}"></button>
<button type="button" id="deleteUserButton${statusUser.count}"></button>
<input id="downloadUserButton${statusUser.count}" type="image" height="25" width="25" src="${contextPath}/resources/images/addUser.png"/>
</td>
</tr>
</c:forEach>
</form>
当我单击添加用户时,此对话框打开
<div id="createUser" title="Add a user" style="display:none">
<fieldset>I do
<form:form actions="${addUserUrl}" modelAttribute="addUserBean">
...
</form:form>
</fieldset>
</div>
I have problem with this form, it generated with two actions, one with this url: /secure/addUser/ and one with /secure/admin/csvUser
I don't understand why
最佳答案
好像是胡扯在缓存或类似的东西,我重新启动了我的想法,这很好