KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > context > servlet > RequestParameterValuesMap


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.context.servlet;
17
18 import java.util.Enumeration JavaDoc;
19
20 import javax.servlet.ServletRequest JavaDoc;
21
22 /**
23  * ServletRequest multi-value parameters as Map.
24  *
25  * @author Anton Koinov (latest modification by $Author: matze $)
26  * @version $Revision: 1.10 $ $Date: 2004/10/13 11:51:00 $
27  */

28 public class RequestParameterValuesMap extends AbstractAttributeMap
29 {
30     private final ServletRequest JavaDoc _servletRequest;
31
32     RequestParameterValuesMap(ServletRequest JavaDoc servletRequest)
33     {
34         _servletRequest = servletRequest;
35     }
36
37     protected Object JavaDoc getAttribute(String JavaDoc key)
38     {
39         return _servletRequest.getParameterValues(key);
40     }
41
42     protected void setAttribute(String JavaDoc key, Object JavaDoc value)
43     {
44         throw new UnsupportedOperationException JavaDoc(
45             "Cannot set ServletRequest ParameterValues");
46     }
47
48     protected void removeAttribute(String JavaDoc key)
49     {
50         throw new UnsupportedOperationException JavaDoc(
51             "Cannot remove ServletRequest ParameterValues");
52     }
53
54     protected Enumeration JavaDoc getAttributeNames()
55     {
56         return _servletRequest.getParameterNames();
57     }
58 }
Popular Tags