1 package org.sapia.soto.state.cocoon; 2 3 import org.apache.cocoon.environment.Request; 4 5 import org.sapia.soto.state.Scope; 6 7 8 18 public class RequestScope implements Scope { 19 public static final String CONTEXT_PATH_KEY = "contextPath"; 20 private Request _req; 21 22 26 public RequestScope(Request req) { 27 _req = req; 28 _req.setAttribute(CONTEXT_PATH_KEY, req.getContextPath()); 29 } 30 31 34 public Object getVal(Object key) { 35 return _req.getAttribute(key.toString()); 36 } 37 38 41 public void putVal(Object key, Object value) { 42 _req.setAttribute(key.toString(), value); 43 } 44 45 48 public Request getRequest() { 49 return _req; 50 } 51 } 52 | Popular Tags |