loginaction.java
来自「webwork入门的例子」· Java 代码 · 共 35 行
JAVA
35 行
package com.lyx.web.action;
import com.lyx.bo.User;
import com.lyx.service.IUserService;
import com.opensymphony.xwork.Action;
import com.opensymphony.xwork.ActionSupport;
import com.opensymphony.xwork.ModelDriven;
@SuppressWarnings("serial")
public class LoginAction extends ActionSupport implements Action,ModelDriven {
//注意这里的User一定要初始化
private User user=new User();
private IUserService userService;
public User getUser() {
return user;
}
public String execute() throws Exception {
if (userService.isValidUser(user))
return this.SUCCESS;
else
return this.ERROR;
}
public Object getModel() {
return user;
}
public void setUserService(IUserService userService) {
this.userService = userService;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?