public class ResourceMapper extends AbstractMapper implements IRequestMapper
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)| 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 IResourceCachingStrategy |
getCachingStrategy() |
int |
getCompatibilityScore(Request request) |
Url |
mapHandler(IRequestHandler requestHandler) |
IRequestHandler |
mapRequest(Request request) |
protected void |
removeCachingDecoration(Url url,
PageParameters parameters) |
encodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, removeMetaParameter, 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 IRequestMapperpublic int getCompatibilityScore(Request request)
getCompatibilityScore in interface IRequestMapperpublic Url mapHandler(IRequestHandler requestHandler)
mapHandler in interface IRequestMapperprotected IResourceCachingStrategy getCachingStrategy()
protected void addCachingDecoration(Url url, PageParameters parameters)
protected void removeCachingDecoration(Url url, PageParameters parameters)
Copyright © 2006–2014 Apache Software Foundation. All rights reserved.