首页>代码>java Struts+Hibernate报价管理系统源代码下载>/baojiaSystem/src/com/sanqing/action/LoginAction.java
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日
最近浏览更多
hawkzl  LV2 2025年4月2日
xianyu091012  LV5 2024年12月26日
黄志琴  LV1 2024年10月19日
m5433660  LV1 2024年3月28日
WBelong  LV8 2023年12月19日
大道寺芝士 2023年11月26日
暂无贡献等级
WanLiuYun  LV12 2023年11月8日
fesfefe  LV13 2023年9月26日
neilyeh 2023年5月29日
暂无贡献等级
lzn00000  LV1 2023年4月24日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友