01: package com.sun.portal.providers.portletwindow;
02:
03: import javax.servlet.http.HttpServletRequest;
04: import javax.servlet.http.HttpServletRequestWrapper;
05:
06: /**
07: * This class is a wrapper over HttpServletRequest
08: * This will help to avoid the problems in multi-threading
09: */
10: public class PAERequestWrapper extends HttpServletRequestWrapper {
11: private Object title;
12: private Object entityID;
13: private Object locale;
14:
15: public PAERequestWrapper(HttpServletRequest req) {
16: super (req);
17: }
18:
19: public Object getAttribute(String name) {
20: if (name.equals(PortletWindowProvider.JAVAX_PORTLET_TITLE)) {
21: return title;
22: } else if (name
23: .equals(PortletWindowProvider.JAVAX_PORTLET_ENTITY_ID)) {
24: return entityID;
25: } else if (name
26: .equals(PortletWindowProvider.JAVAX_PORTLET_LOCALE)) {
27: return locale;
28: } else {
29: return super .getAttribute(name);
30: }
31: }
32:
33: public void setAttribute(String name, Object o) {
34: if (name.equals(PortletWindowProvider.JAVAX_PORTLET_TITLE)) {
35: title = o;
36: } else if (name
37: .equals(PortletWindowProvider.JAVAX_PORTLET_ENTITY_ID)) {
38: entityID = o;
39: } else if (name
40: .equals(PortletWindowProvider.JAVAX_PORTLET_LOCALE)) {
41: locale = o;
42: } else {
43: super.setAttribute(name, o);
44: }
45: }
46:
47: }
|