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