1 package net.sf.jguard.jee.authentication.http; 2 3 import java.util.HashMap ; 4 import java.util.Map ; 5 6 import javax.servlet.http.HttpSession ; 7 8 import com.kizna.servletunit.HttpSessionSimulator; 9 10 11 public class HttpServletRequestSimulator extends 12 com.kizna.servletunit.HttpServletRequestSimulator { 13 14 private HttpSession session = null; 15 private Map attributes = null; 16 private boolean secure = false; 17 18 public HttpServletRequestSimulator(){ 19 super(); 20 attributes = new HashMap (); 21 } 22 public HttpSession getSession() { 23 return session; 24 } 25 26 public HttpSession getSession(boolean b) { 27 if(b && session == null){ 28 session = new HttpSessionSimulator(); 29 } 30 return session; 31 } 32 public void setSession(HttpSession session) { 33 this.session = session; 34 } 35 36 public Object getAttribute(String attKey){ 37 38 return attributes.get(attKey); 39 } 40 41 public void setAttribute(String attKey,Object value){ 42 attributes.put(attKey, value); 43 } 44 public boolean isSecure() { 45 return secure; 46 } 47 public void setSecure(boolean secure) { 48 this.secure = secure; 49 } 50 } 51 | Popular Tags |