?? userregisteraction.java
字號:
/**
*
*/
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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -