userregisteraction.java

来自「ssh2注册查询搜索分页实例ssh2注册查询搜索分页实例」· Java 代码 · 共 58 行

JAVA
58
字号
/**
 * 
 */
package com.feiling.web.user;

import com.feiling.dao.domain.User;
import com.feiling.service.UserService;
import com.feiling.web.domain.UserRegisterForm;
import com.opensymphony.xwork2.ActionSupport;

/**
 * @author 邓飞玲
 * Sep 11, 2008
 * deng819@163.com
 */
public class UserRegisterAction extends AbstractActionSupport {
	private UserRegisterForm regForm;
	private UserService userService;
	/**
	 * @param userService the userService to set
	 */
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	@Override
	public String execute() throws Exception
	{
		if(regForm == null)
		{
			System.out.println("return input!");
			regForm = new UserRegisterForm();
			return INPUT;
		}
		else
		{
			System.out.println("return success!user name=>" + regForm.getUsername());
			User user = new User();
			user.setUsername(regForm.getUsername());
			user.setPassword(regForm.getPassword());
			user.setEmail(regForm.getEmail());
			userService.registerUser(user);
			return SUCCESS;
		}
	}
	/**
	 * @return the regForm
	 */
	public UserRegisterForm getRegForm() {
		return regForm;
	}
	/**
	 * @param regForm the regForm to set
	 */
	public void setRegForm(UserRegisterForm regForm) {
		this.regForm = regForm;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?