首页>代码>S2SH开发学生选课系统>/CourseSel/src/com/course/action/AdminLoginAction.java
package com.course.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.course.service.IAdminService;
import com.course.service.IStuService;
import com.opensymphony.xwork2.ActionSupport;

public class AdminLoginAction extends ActionSupport {

    IAdminService adminService;
	
	private String name;
	private String pwd;
	
	public IAdminService getAdminService() {
		return adminService;
	}
	public void setAdminService(IAdminService adminService) {
		this.adminService = adminService;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	
	@Override
	public String execute() throws Exception {
		
		HttpServletRequest request=ServletActionContext.getRequest();
		if(adminService.checkAdmin(name, pwd)) 
		{
			request.getSession().setAttribute("admin", name);
        	return SUCCESS;
		}
        else
        	request.setAttribute("error", "用户名或密码错误");
        	return INPUT;
	}
}
最近下载更多
无敌LL  LV2 2023年11月3日
wk10245  LV1 2022年10月9日
awhdauiwd  LV1 2022年2月28日
*  LV1 2021年12月19日
lihuazhen  LV2 2021年12月15日
萨维团结阿u  LV1 2021年7月5日
毫无qiushengyu  LV2 2021年7月3日
Administrator  LV3 2021年6月25日
阳止初四  LV8 2021年6月6日
864152530  LV5 2021年6月2日
最近浏览更多
潘潘123456  LV2 3月2日
WBelong  LV7 2023年12月25日
whitestrong 2023年12月17日
暂无贡献等级
43717604 2023年12月8日
暂无贡献等级
zhangjilu  LV18 2023年11月21日
无敌LL  LV2 2023年11月3日
刘洋66666  LV1 2023年10月31日
卢本伟不开挂  LV4 2023年10月22日
haotzy  LV3 2023年10月5日
Zgordon  LV1 2023年5月29日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友