dummyhttpsession.java

来自「考勤管理系统源码」· Java 代码 · 共 118 行

JAVA
118
字号
package com.wiley.compBooks.EJwithUML.Base.TestUtilities;import javax.servlet.http.*;import javax.servlet.*;import java.util.*;import java.io.*;public class DummyHttpSession implements HttpSession{  private Hashtable attributes = new Hashtable();  // configuration methods// HttpSession methodspublic Object getAttribute(String name){  return this.attributes.get(name);}public Enumeration getAttributeNames(){  return this.attributes.keys();}public long getCreationTime(){  return 1L;}public String getId(){  return null;}public long getLastAccessedTime(){  return 1L;}public int getMaxInactiveInterval(){  return 1;}public ServletContext getServletContext(){  return null;}public HttpSessionContext getSessionContext(){  return null;}public Object getValue(String name){  return this.attributes.get(name);}public String[] getValueNames(){  return null;}public void invalidate(){}public boolean isNew(){  return false;}public void putValue(String name, Object value){  this.attributes.put(name, value);}public void removeAttribute(String name){  this.attributes.remove(name);}public void removeValue(String name){  this.attributes.remove(name);}public void setAttribute(String name, Object value){  this.attributes.put(name, value);}public void setMaxInactiveInterval(int interval){}}

⌨️ 快捷键说明

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