01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.springframework.web.portlet.context;
18:
19: import java.security.Principal;
20: import java.util.Locale;
21: import java.util.Map;
22:
23: import javax.portlet.PortletRequest;
24:
25: import org.springframework.web.context.request.WebRequest;
26:
27: /**
28: * {@link org.springframework.web.context.request.WebRequest} adapter
29: * for a {@link javax.portlet.PortletRequest}.
30: *
31: * @author Juergen Hoeller
32: * @since 2.0
33: */
34: public class PortletWebRequest extends PortletRequestAttributes
35: implements WebRequest {
36:
37: /**
38: * Create a new PortletWebRequest instance for the given request.
39: * @param request current portlet request
40: */
41: public PortletWebRequest(PortletRequest request) {
42: super (request);
43: }
44:
45: public String getParameter(String paramName) {
46: return getRequest().getParameter(paramName);
47: }
48:
49: public String[] getParameterValues(String paramName) {
50: return getRequest().getParameterValues(paramName);
51: }
52:
53: public Map getParameterMap() {
54: return getRequest().getParameterMap();
55: }
56:
57: public Locale getLocale() {
58: return getRequest().getLocale();
59: }
60:
61: public String getContextPath() {
62: return getRequest().getContextPath();
63: }
64:
65: public String getRemoteUser() {
66: return getRequest().getRemoteUser();
67: }
68:
69: public Principal getUserPrincipal() {
70: return getRequest().getUserPrincipal();
71: }
72:
73: public boolean isUserInRole(String role) {
74: return getRequest().isUserInRole(role);
75: }
76:
77: public boolean isSecure() {
78: return getRequest().isSecure();
79: }
80:
81: }
|