01: package com.ibatis.struts.httpmap;
02:
03: import java.util.Enumeration;
04:
05: import javax.servlet.http.HttpServletRequest;
06:
07: /**
08: * Map to wrap request scope attributes. <p/>Date: Mar 11, 2004 10:35:34 PM
09: *
10: * @author Clinton Begin
11: */
12: public class RequestMap extends BaseHttpMap {
13:
14: private HttpServletRequest request;
15:
16: public RequestMap(HttpServletRequest request) {
17: this .request = request;
18: }
19:
20: protected Enumeration getNames() {
21: return request.getAttributeNames();
22: }
23:
24: protected Object getValue(Object key) {
25: return request.getAttribute(String.valueOf(key));
26: }
27:
28: protected void putValue(Object key, Object value) {
29: request.setAttribute(String.valueOf(key), value);
30: }
31:
32: protected void removeValue(Object key) {
33: request.removeAttribute(String.valueOf(key));
34: }
35:
36: }
|