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

📄 loginaction.java

📁 系统运行时的截屏图:webstart_screen01.gif/webstart_screen02.gif。 安装使用前
💻 JAVA
字号:
/**
 * Copyright(c) 2005 Dragonfly - created by FengChun
 * All Rights Reserved.
 *
 * Package: org.dragonfly.webstart.actions
 * FileName: RunExeAction.java
 *
 * Version: 1.0
 * Created: 2005-7-8 22:01:00
 * Updated: 2005-7-8 22:01:00
 *
 * Author: FengChun - f15_nsm@hotmail.com
 * Description:
 * Function:
 *
 */

package org.dragonfly.webstart.actions;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import org.dragonfly.webstart.runtime.WebStartException;
import org.dragonfly.config.*;

public class LoginAction
    extends Action {
  public ActionForward perform(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest request,
                               HttpServletResponse response) {
    ActionForward forward = new ActionForward();
    try {
      String id = (String) request.getParameter("id");
      String pwd = (String) request.getParameter("pwd");

      if (id==null || pwd == null) {
        throw new WebStartException();
      }

      if ("".equals(pwd)) {
        request.setAttribute("ReturnMsg","请输入密码!");
        throw new WebStartException();
      }

      if (!pwd.equals(PropertiesReader.getKeyValue("safeset",
          id + ".User.Password"))) {
        request.setAttribute("ReturnMsg","密码与身份不符!");
        throw new WebStartException();
      }

      request.setAttribute("USERID",id);
      forward = actionMapping.findForward("login_succ");
    }
    catch (Exception ex) {
      forward = actionMapping.findForward("login_fail");
    }

    // Finish with
    return (forward);
  }
}

⌨️ 快捷键说明

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