|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.protocol.http.portlet.WicketFilterPortletContext
public class WicketFilterPortletContext
Handles Portlet specific filtering requirements.
The WicketFilterPortletContext first checks if it is a Portlet based request or a direct browser (servlet) request. If the request is a direct browser request it simply delegates the request to theWicketFilter
and "normal" Wicket web application handling continues. This allows
deploying the same Wicket application (with the same web.xml) as a normal web application too (as
long as you don't use portlet specific features within your application).
If the request is dispatched from the WicketPortlet (easily determined from request attributes),
the WicketPortletFilter wraps the servlet request and response objects with specialized portlet
environment versions. Furthermore, the Servlet Session object will be wrapped to provide an
isolated PORTLET_SCOPED session to Wicket to support multiple windows of the same portlet. And
the RenderStrategy IRequestCycleSettings.REDIRECT_TO_RENDER
will have to be enforced when
invoked from portlet processAction, otherwise IRequestCycleSettings.ONE_PASS_RENDER
.
Thereafter, the WicketFilterPortletContext
can let the standard WicketFilter
handle the request as if it were a "normal" web based request.
WicketFilter
Constructor Summary | |
---|---|
WicketFilterPortletContext()
|
Method Summary | |
---|---|
boolean |
createPortletRequestContext(WebRequest request,
WebResponse response)
Factory method which will delegate to newPortletRequestContext(ServletWebRequest, WebResponse) to create the
PortletRequestContext if the request is in a portlet context. |
String |
decodePortletWindowId(String pathInfo)
FIXME javadoc Try to extract the portlet's window id from the request url. |
String |
encodeWindowIdInPath(String windowId,
CharSequence path)
Encodes the given path portlet window id. |
String |
getServletResourceUrlPortletWindowIdPrefix()
|
void |
initFilter(javax.servlet.FilterConfig filterConfig,
WebApplication webApplication)
Overrides render strategy and adds the PortletInvalidMarkupFilter filter. |
protected void |
newPortletRequestContext(ServletWebRequest request,
WebResponse response)
Factory method to create the PortletRequestContext . |
boolean |
setupFilter(javax.servlet.FilterConfig config,
FilterRequestContext filterRequestContext,
String filterPath)
Sets up the filter to process a given request cycle. |
String |
stripWindowIdFromPathInfo(String pathInfo)
FIXME javadoc |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WicketFilterPortletContext()
Method Detail |
---|
public void initFilter(javax.servlet.FilterConfig filterConfig, WebApplication webApplication) throws javax.servlet.ServletException
PortletInvalidMarkupFilter
filter.
webApplication
-
javax.servlet.ServletException
PortletInvalidMarkupFilter
public boolean setupFilter(javax.servlet.FilterConfig config, FilterRequestContext filterRequestContext, String filterPath) throws IOException, javax.servlet.ServletException
Also sets up the session proxy using Apache Portals Bridge to ensure portlet session isolation. This is an option feature of Portal 2.0 spec so we just use portal bridges instead as it guarantees us support.
config
- filter configurationfilterRequestContext
- filterPath
-
IOException
javax.servlet.ServletException
org.apache.portals.bridges.util.ServletPortletSessionProxy
public boolean createPortletRequestContext(WebRequest request, WebResponse response)
newPortletRequestContext(ServletWebRequest, WebResponse)
to create the
PortletRequestContext
if the request is in a portlet context.
request
- response
-
public String getServletResourceUrlPortletWindowIdPrefix()
SERVLET_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX
public String decodePortletWindowId(String pathInfo)
pathInfo
- the url relative to the servlet context and filter path
public String stripWindowIdFromPathInfo(String pathInfo)
If the pathInfo contains the portlet window id namespace prefix, remove it.
pathInfo
-
public String encodeWindowIdInPath(String windowId, CharSequence path)
windowId
- path
-
protected void newPortletRequestContext(ServletWebRequest request, WebResponse response)
PortletRequestContext
.
request
- response
- createPortletRequestContext(WebRequest, WebResponse)
,
PortletRequestContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |