public class ResourceMapper extends AbstractBookmarkableMapper
IRequestMapper to mount resources to a custom mount path
/myresources/${category}/images/[indexed-param-0]/[indexed-param-1]?[named-param-1=value]&[named-param-2=value2]
mountResource("/images", new ImagesResourceReference()));
Note: Mounted this way the resource reference has application scope, i.e. it is shared between
all users of the application. It is recommended to not keep any state in it.WebApplication.mountResource(String,
org.apache.wicket.request.resource.ResourceReference)AbstractBookmarkableMapper.MountPathSegment, AbstractBookmarkableMapper.UrlInfopageParametersEncoder, pathSegments| Constructor and Description |
|---|
ResourceMapper(String path,
ResourceReference resourceReference)
create a resource mapper for a resource
|
ResourceMapper(String path,
ResourceReference resourceReference,
IPageParametersEncoder encoder)
create a resource mapper for a resource
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCachingDecoration(Url url,
PageParameters parameters) |
protected Url |
buildUrl(AbstractBookmarkableMapper.UrlInfo info)
Builds URL for the given
AbstractBookmarkableMapper.UrlInfo instance. |
protected IResourceCachingStrategy |
getCachingStrategy() |
int |
getCompatibilityScore(Request request) |
Url |
mapHandler(IRequestHandler requestHandler) |
IRequestHandler |
mapRequest(Request request) |
protected boolean |
pageMustHaveBeenCreatedBookmarkable()
Indicates whether hybrid
RenderPageRequestHandler URL for page will be generated only
if page has been created with bookmarkable URL. |
protected AbstractBookmarkableMapper.UrlInfo |
parseRequest(Request request)
Parse the given request to an
AbstractBookmarkableMapper.UrlInfo instance. |
protected void |
removeCachingDecoration(Url url,
PageParameters parameters) |
checkPageClass, checkPageInstance, extractPageParameters, getMatchedSegmentSizes, getPageInfo, getPathSegments, isCaseSensitiveMatch, isFixedSegment, processBookmarkable, processHybrid, processListener, segmentsMatch, setCaseSensitiveMatch, setPlaceholders, urlStartsWithMountedSegmentscleanClassName, encodePageComponentInfo, getContext, getPageClass, getPageComponentInfo, removeMetaParameter, requestListenerInterfaceFromString, requestListenerInterfaceToStringencodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, safeSegmentGetter, urlStartsWithpublic ResourceMapper(String path, ResourceReference resourceReference)
path - mount path for the resourceresourceReference - resource reference that should be linked to the mount pathResourceMapper(String, org.apache.wicket.request.resource.ResourceReference,
org.apache.wicket.request.mapper.parameter.IPageParametersEncoder)public ResourceMapper(String path, ResourceReference resourceReference, IPageParametersEncoder encoder)
path - mount path for the resourceresourceReference - resource reference that should be linked to the mount pathencoder - encoder for url parameterspublic IRequestHandler mapRequest(Request request)
mapRequest in interface IRequestMappermapRequest in class AbstractBookmarkableMapperprotected final AbstractBookmarkableMapper.UrlInfo parseRequest(Request request)
AbstractBookmarkableMapperAbstractBookmarkableMapper.UrlInfo instance.parseRequest in class AbstractBookmarkableMappernull if this encoder can not handle the requestprotected final Url buildUrl(AbstractBookmarkableMapper.UrlInfo info)
AbstractBookmarkableMapperAbstractBookmarkableMapper.UrlInfo instance. The URL this method produces must be
parseable by the AbstractBookmarkableMapper.parseRequest(Request) method.buildUrl in class AbstractBookmarkableMapperprotected final boolean pageMustHaveBeenCreatedBookmarkable()
AbstractBookmarkableMapperRenderPageRequestHandler URL for page will be generated only
if page has been created with bookmarkable URL.
For generic bookmarkable encoders this method should return true. For explicit
(mounted) encoders this method should return false
pageMustHaveBeenCreatedBookmarkable in class AbstractBookmarkableMappertrue if hybrid URL requires page created bookmarkable,
false otherwise.public int getCompatibilityScore(Request request)
getCompatibilityScore in interface IRequestMappergetCompatibilityScore in class AbstractBookmarkableMapperpublic Url mapHandler(IRequestHandler requestHandler)
mapHandler in interface IRequestMappermapHandler in class AbstractBookmarkableMapperprotected IResourceCachingStrategy getCachingStrategy()
protected void addCachingDecoration(Url url, PageParameters parameters)
protected void removeCachingDecoration(Url url, PageParameters parameters)
Copyright © 2006–2021 Apache Software Foundation. All rights reserved.