日期:2014-05-19 浏览次数:20801 次
public class UserManageAction extends ActionSupport{
private @Resource Userinfo userinfo;
private @Resource IUserinfoDAO userinfoDAO;
public String edit(){
userinfo=userinfoDAO.findById(userinfo.getUserId());
return SUCCESS;
}
public String update(){
System.out.println(userinfo.getUserId());
userinfoDAO.merge(userinfo);
return SUCCESS;
}
public void setUserinfo(Userinfo userinfo) {
this.userinfo = userinfo;
}
public Userinfo getUserinfo() {
return userinfo;
}
<s:form name="update" action="update" namespace="/userManege" method="post">
<table>
<tr>
<td>用户编号:</td>
<td ><s:textfield name="userinfo.userId" disabled="true"/></td>
</tr>
<tr>
<td>用户名:</td>
<td ><s:textfield name="userinfo.userName" disabled="true"/></td>
</tr>
<tr>
<td>昵称:</td>
<td ><s:textfield name="userinfo.userNickname" /></td>
</tr>
<tr>
<td>性别:</td>
<td colspan="4">
<s:radio list="#{true:'男',false:'女'}" name="userinfo.userGender" ></s:radio>
</td>
</tr>
<tr>
<td>电子邮箱:</td>
<td ><s:textfield name="userinfo