67,513
社区成员
发帖
与我相关
我的任务
分享
userlist.jsp
<a href='adminUser.do?pare=toUpdate&id=admin.getId()'修改></a>
user.action
//跳转到相应的action
public ActionForward toUpdate(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
int id = Integer.parseInt(request.getParameter("id"));
User user = userBiz.findUserById(id);
UserForm userForm = (UserForm) form;
petOpForm.setPet(pet);
//获取城市列表,他是city表的数据,user表也有个字段是city
List citylist=modoerAreacodeDao.findAll();
request.setAttribute("cityList", citylist);
//跳转到更新页面
return mapping.findForward("toUpdateUser");
}
UpdateUser.jsp
<html:form action="/user" method="post">
<html:hidden property="method" value="doUpdateUser"/>
<table>
<tr>
<td>姓名:</td>
<td><html:text property="user.name" /></td>
</tr>
<td>城市:</td>
?????????????????????????????????????????
<tr>
<html:submit value="更新" /></td>
</tr>
</table>
</html:form>
<select name="" id="">
<c:forEach items="${cityList}" var="city">
<option value="city">city</option>
</c:forEach>
</select>