⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logonaction.java

📁 eclipse java/jsp 航空管理系统
💻 JAVA
字号:
package kangyi.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
//import java.util.*;
import kangyi.form.LogonForm;
import kangyi.model.Logon;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import zhangchunliang.model.AppMode;

/**
 * <p>Description  :  登陆界面跳转 </p>
 * <p>Project      :  ciqms
 * <p>Company      :  东软股份国际合作事业部</p>
 * <p>Create Date  :  2005.4.25</P>
 * @author         :  康毅 | kangyi@neusoft.com
 * @version        :  0.1
 */
public class LogonAction extends Action {
    public ActionForward execute(ActionMapping map, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
    	
		if(!AppMode.getAppMode()){
			System.out.println("Application is terminated...");
			return map.findForward("appInfo");
		}
        
        String id = request.getParameter("id");
        String password = request.getParameter("password");
        
        ((LogonForm) form).setId(id);
        ((LogonForm) form).setPassword(password);
        
        LogonForm logonform=((LogonForm) form);
        
        Logon logon=new Logon();
        
        int info=logon.UserLogon(logonform);
        if(info==1){
            String strgrant[]=logon.UserGrant(logonform);
            /**String tablename=logon.UserTable(logonform);*/
            String str=logon.findTable(logonform);
            /**List a=logon.findTables(logonform);*/
            request.getSession().setAttribute("sid",id);
            request.getSession().setAttribute("userSelectGrant",strgrant[0]);
            request.getSession().setAttribute("userAddGrant",strgrant[1]);
            request.getSession().setAttribute("userDeleteGrant",strgrant[2]);
            request.getSession().setAttribute("userUpdateGrant",strgrant[3]);
            request.getSession().setAttribute("userAdminGrant",strgrant[4]);
           /**request.getSession().setAttribute("userTableName",tablename);*/
           /**request.getSession().setAttribute("userTableNameList",a);*/
            request.getSession().setAttribute("userTableName",str);
            return map.findForward("success");   
        }else if(info==2){
            return map.findForward("failing");   
        }else if(info==3){
            return map.findForward("failing");
        }else if(info==7){
            return map.findForward("failing");
        }else
            return map.findForward("failing");

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -