package book.com.cn.action; import book.com.cn.bean.User; import book.com.cn.service.UserService; import com.opensymphony.xwork2.ActionSupport; import java.util.Date; import javax.swing.JOptionPane; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class AddUserAction extends ActionSupport { private String username, password; private int id; private UserService userService; // 业务逻辑处理组件,用接口定义,不用类定义 public void setUserService(UserService userService) { this.userService = userService; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String execute() throws Exception { User user = new User(); user.setId(id); user.setUsername(username); user.setPassword(password); if (userService.addUser(user)) return SUCCESS; else return ERROR; } }
最近下载更多
fffffffanan LV1
3月2日
微信网友_6248713511227392 LV11
2022年12月5日
ming_123_9715 LV23
2022年12月4日
漫长的白日梦 LV8
2021年12月8日
liuyanmei LV3
2021年5月19日
zxygcl LV5
2020年6月26日
zhaoxiangli LV2
2020年6月24日
menghailan LV4
2020年5月17日
恣意ah LV7
2020年1月2日
liuqinmin LV1
2019年12月22日