package com.sanqing.action;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.sanqing.service.UserService;
/**
* 用户登录
*/
@Controller("loginAction")
@Scope("prototype")
public class LoginAction extends ActionSupport {
@Resource
private UserService userService ;
private String username ;
private String password ;
@Override
public String execute() throws Exception {
if(!userService.login(username, password)) {
return this.INPUT;
}else{
Map session = ActionContext.getContext().getSession();
session.put("user", userService.find(username));
}
return this.SUCCESS;
}
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;
}
}
最近下载更多
ming_123_9715 LV23
2022年12月9日
.. LV8
2022年2月24日
GLNobody LV1
2022年1月6日
小洪123 LV4
2021年10月15日
苏叶2516 LV2
2021年5月9日
ericxu1116 LV24
2021年5月1日
admin_z LV22
2021年4月20日
zhouzhiyi LV5
2021年3月15日
fenghuang8 LV22
2021年3月11日
z_lying LV20
2021年1月1日

最近浏览