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 form parameters. <p/>Date: Mar 11, 2004 10:35:52 PM
09: *
10: * @author Clinton Begin
11: */
12: public class ParameterMap extends BaseHttpMap {
13:
14: private HttpServletRequest request;
15:
16: public ParameterMap(HttpServletRequest request) {
17: this .request = request;
18: }
19:
20: protected Enumeration getNames() {
21: return request.getParameterNames();
22: }
23:
24: protected Object getValue(Object key) {
25: return request.getParameter(String.valueOf(key));
26: }
27:
28: protected Object[] getValues(Object key) {
29: return request.getParameterValues(String.valueOf(key));
30: }
31:
32: protected void putValue(Object key, Object value) {
33: throw new UnsupportedOperationException(
34: "Cannot put value to ParameterMap.");
35: }
36:
37: protected void removeValue(Object key) {
38: throw new UnsupportedOperationException(
39: "Cannot remove value from ParameterMap.");
40: }
41:
42: }
|