首页>代码>ssh实现的投票管理系统>/ssh实现的注册登录增删改查图书管理系统/SSHBookManage/src/book/com/cn/action/AddUserAction.java
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日
最近浏览更多
qibodong  LV14 4月17日
wananall  LV13 3月13日
fffffffanan  LV1 3月1日
laishaofe  LV7 1月16日
Magic丶M  LV6 2023年12月29日
pangzhihui  LV12 2023年11月16日
阿卜杜萨拉木 2023年11月7日
暂无贡献等级
fesfefe  LV13 2023年11月6日
政政123456  LV3 2023年10月22日
27866849  LV4 2023年9月21日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友