loginaction.java

来自「系统运行时的截屏图:webstart_screen01.gif/webstart」· Java 代码 · 共 61 行

JAVA
61
字号
/**
 * 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 + =
减小字号Ctrl + -
显示快捷键?