adminsession.java

来自「天乙代码src_531.rar 天乙代码src_531.rar 天乙代」· Java 代码 · 共 35 行

JAVA
35
字号
package com.laoer.bbscs.servlet;

import javax.servlet.*;
import javax.servlet.http.*;

/**
 * <p>Title: 天乙社区V5.0</p>
 * <p>Description: BBS-CS天乙社区V5.0</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: laoer.com</p>
 * @author 龚天乙
 * @version 5.0
 */

public class AdminSession {

  boolean sessionOK = true;
  String name = "";
  String passwd = "";

  public AdminSession(HttpServletRequest request) {
    HttpSession httpsession = request.getSession();
    this.name = (String) httpsession.getAttribute("name");
    this.passwd = (String) httpsession.getAttribute("passwd");
  }

  public boolean checkSession() {
    if (this.name == null || this.name.length() == 0 || this.passwd == null ||
        this.passwd.length() == 0) {
      this.sessionOK = false;
    }
    return this.sessionOK;
  }

}

⌨️ 快捷键说明

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