public class PortletHttpSessionWrapper extends Object implements InvocationHandler
Proxy for a Servlet HttpSession to attach to a PortletSession, providing only access to
PORTLET_SCOPE session attributes and hiding the APPLICATION_SCOPE attributes from the Servlet.
This Proxy can be used to isolate two instances of the same Portlet dispatching to Servlets so
they don't overwrite or read each others session attributes.
Note: If an APPLICATION_SCOPE session attribute is going to be stored with a name which does
not start with a wicket prefix (look at
WebApplication.getSessionAttributePrefix(org.apache.wicket.request.http.WebRequest, String)
) then the attribute will be stored normally as APPLICATION_SCOPED session attribute and this
attribute will be accessible from every wicket portlet.
| Modifier and Type | Method and Description |
|---|---|
static HttpSession |
createProxy(HttpServletRequest request,
String portletWindowId,
String wicketSessionAttributePrefix) |
Object |
invoke(Object proxy,
Method m,
Object[] args) |
public static HttpSession createProxy(HttpServletRequest request, String portletWindowId, String wicketSessionAttributePrefix)
Copyright © 2020. All rights reserved.