public class RootWebRequestProcessor
extends org.apache.wicket.protocol.http.request.urlcompressing.UrlCompressingWebRequestProcessor
To use root mounts, make sure your application overrides
WebApplication.newRequestCycleProcessor()
and returns an instance of this. Secondly, these root mounts MUST be mounted directly via
WebApplication.mount(org.apache.wicket.request.target.coding.IRequestTargetUrlCodingStrategy).
For example use Application.mountOnRoot(RootMountedUrlCodingStrategy).
In addition you may want to configure ignorePaths as described below.
The following request handlers are considered in order:
To speed up URL processing, it is RECOMMENDED to move all non-Wicket content (i.e. servlets and static content in the WEB-INF directory) behind a clear URL path and let the Wicket filter ignore these URLs. You MUST do this if you want to combine non-Wicket content with the optional not-found page.
Here is an example fragment of the ignorePath parameter that makes the Wicket filter ignore all
request for /favicon.ico, /robots.txt and requests of which the path starts with
/static/ and /servletpath/:
<!-- The Wicket application filter. -->
<filter>
<filter-name>wicket.filter</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
<init-param>
<param-name>ignorePaths</param-name>
<param-value>favicon.ico,robots.txt,static/,servletpath/</param-value>
</init-param>
</filter>
You can find this XML in your WEB.xml. (The example XML above uses Spring to instantiate the application class.)
See class comment of UrlCompressingWebRequestProcessor for more information on the
purpose of the base class. Alternatively, this could extend
WebRequestCycleProcessor.
| Constructor and Description |
|---|
RootWebRequestProcessor(List<RootMountedUrlCodingStrategy> rootMounts)
Constructor.
|
RootWebRequestProcessor(List<RootMountedUrlCodingStrategy> rootMounts,
Class<P> notFoundPage)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.wicket.request.IRequestCodingStrategy |
newRequestCodingStrategy() |
resolveListenerInterfaceTargetpublic RootWebRequestProcessor(List<RootMountedUrlCodingStrategy> rootMounts)
rootMounts - a list of root mounts in the order in which they are tried (not null)
The list must be immutable or an implementation of something like
CopyOnWriteArrayList.public RootWebRequestProcessor(List<RootMountedUrlCodingStrategy> rootMounts, Class<P> notFoundPage)
rootMounts - a list of root mounts in the order in which they are tried (not null)
The list must be immutable or an implementation of something like
CopyOnWriteArrayList.notFoundPage - the page to forward to when none of the root mounts accepts the current request, or null
to fall through to the servlet container. When this value is non-null, and you have non-wicket content,
you MUST configure ignorePaths in the webapp.xml as described in the
class comment (for performance this is recommended anyway).Copyright © 2013. All Rights Reserved.