日期:2014-05-17 浏览次数:20727 次
public class UserLoginAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
private String user_name;
private String user_pwd;
private String msg;
// 验证用户是否存在
@SuppressWarnings("unchecked")
public String userLogin() throws Exception {
System.out.println("用户名:" + user_name);
System.out.println("用户密码:" + user_pwd);
Map<String, Object> session = ActionContext.getContext().getSession();
Map<String, Object> request = (Map<String, Object>) ActionContext
.getContext().get("request");
System.out.println("request的类型是:"
+ ActionContext.getContext().get("request").getClass());
CRM_User user = new UserDaoImpl().userLogin(user_name, user_pwd);
System.out.println("用户电话:" + user.getUser_phone());
session.put("user", user);
session.put("user_id", user.getUser_id());
session.put("user_name", user.getUser_condition());
session.put("user_power", user.getUser_power());
session.put("user_id", user.getUser_isdel());
session.put("user_id", user.getUser_phone());
request.put("requestuser", user);
return SUCCESS;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
public String getUser_name() {
return user_name;
}
public void setUser_name(String user_name) {
this.user_name = user_name;
}
public String getUser_pwd() {
return user_pwd;
}
public void setUser_pwd(String user_pwd) {
this.user_pwd = user_pwd;
}
}
//通过用户名和用户密码查询用户(登录)
CRM_User userLogin(String username,String password)throws Exception;