org.apache.wicket.core.request.mapper
Class ResourceMapper
java.lang.Object
org.apache.wicket.request.mapper.AbstractMapper
org.apache.wicket.core.request.mapper.ResourceMapper
- All Implemented Interfaces:
- IRequestMapper
public class ResourceMapper
- extends AbstractMapper
- implements IRequestMapper
A IRequestMapper
to mount resources to a custom mount path
- maps indexed parameters to path segments
- maps named parameters to query string arguments or placeholder path segments
sample structure of url
/myresources/${category}/images/[indexed-param-0]/[indexed-param-1]?[named-param-1=value]&[named-param-2=value2]
sample usage
in your wicket application's init() method use a statement like this
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.
- Author:
- Peter Ertl
- See Also:
WebApplication.mountResource(String,
org.apache.wicket.request.resource.ResourceReference)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceMapper
public ResourceMapper(String path,
ResourceReference resourceReference)
- create a resource mapper for a resource
- Parameters:
path
- mount path for the resourceresourceReference
- resource reference that should be linked to the mount path- See Also:
ResourceMapper(String, org.apache.wicket.request.resource.ResourceReference,
org.apache.wicket.request.mapper.parameter.IPageParametersEncoder)
ResourceMapper
public ResourceMapper(String path,
ResourceReference resourceReference,
IPageParametersEncoder encoder)
- create a resource mapper for a resource
- Parameters:
path
- mount path for the resourceresourceReference
- resource reference that should be linked to the mount pathencoder
- encoder for url parameters
mapRequest
public IRequestHandler mapRequest(Request request)
- Specified by:
mapRequest
in interface IRequestMapper
getCompatibilityScore
public int getCompatibilityScore(Request request)
- Specified by:
getCompatibilityScore
in interface IRequestMapper
mapHandler
public Url mapHandler(IRequestHandler requestHandler)
- Specified by:
mapHandler
in interface IRequestMapper
getCachingStrategy
protected IResourceCachingStrategy getCachingStrategy()
addCachingDecoration
protected void addCachingDecoration(Url url,
PageParameters parameters)
removeCachingDecoration
protected void removeCachingDecoration(Url url,
PageParameters parameters)
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.