1 18 package org.apache.beehive.netui.script.el.util; 19 20 import java.util.Enumeration ; 21 import javax.servlet.http.HttpSession ; 22 23 26 public class SessionAttributeMap 27 extends AbstractAttributeMap 28 implements BindingContext { 29 30 private HttpSession _session = null; 31 32 public SessionAttributeMap(HttpSession session) { 33 this._session = session; 34 } 35 36 public Object unwrap() { 37 return _session; 38 } 39 40 protected Object getValue(Object key) { 41 return _session.getAttribute(key.toString()); 42 } 43 44 protected Object putValue(Object key, Object value) { 45 String strKey = key.toString(); 46 Object prev = _session.getAttribute(strKey); 47 48 _session.setAttribute(strKey, value); 49 50 return prev; 51 } 52 53 protected Enumeration getKeysEnumeration() { 54 return _session.getAttributeNames(); 55 } 56 } 57 | Popular Tags |