<s:form action="user_save">
<s:token></s:token>
<s:textfield name="username" label="用户名"></s:textfield>
<s:textfield name="pwd" label="密码"></s:textfield>
<s:submit value="提交"></s:submit>
</s:form>
package com.xinzhi.action;
import java.util.List;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.util.ValueStack;
import com.xinzhi.dao.impl.UserDaoImpl;
import com.xinzhi.entity.UserEntity;
public class UserAction extends ActionSupport implements
ModelDriven<UserEntity> {
private static final long serialVersionUID = 1L;
private UserEntity userEntity = new UserEntity();
UserDaoImpl userDaoImpl = new UserDaoImpl();
public UserEntity getUserEntity() {
return userEntity;
}
public void setUserEntity(UserEntity userEntity) {
this.userEntity = userEntity;
}
public UserEntity getModel() {
return userEntity;
}
}
public String view() {
UserEntity selectAUserEntity = userDaoImpl.selectAUserEntity(userEntity
.getId());
ValueStack valueStack = ActionContext.getContext().getValueStack();
valueStack.pop();
valueStack.push(selectAUserEntity);
return "view";
}
<s:form action="user_save">
<s:token></s:token>
<s:textfield name="username" label="用户名"></s:textfield>
<s:textfield name="pwd" label="密码"></s:textfield>
<s:submit value="提交"></s:submit>
</s:form>
<action name="user_*" class="com.xinzhi.action.UserAction" method="{1}">
<interceptor-ref name="defaultStack"></interceptor-ref>
<interceptor-ref name="token">
<param name="includeMethods">save</param>
</interceptor-ref>
</action>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有