|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy org.apache.wicket.request.target.coding.IndexedSharedResourceCodingStrategy
public class IndexedSharedResourceCodingStrategy
Indexed url encoding for shared resources with optional query parameters
for example, with this url/mountpath/foo/bar/baz?name=joe&languages=java&languages=scalathe parameters value map will be
Key | Value |
---|---|
"0" | "foo" |
"1" | "bar" |
"2" | "baz" |
"name" | "joe" |
"languages" | String[] { "java", "scala" } |
/images/{imagename}.{format} /blog/2008/05/12/47-test-blog-entry.html
with
absolutely no effort.
Can be used in WebApplication like this:
mount(new IndexedSharedResourceCodingStrategy(path, sharedResourceKey);
The greatest benefit is that shared resource urls look like static resources for the browser.
This comes especially handy when utilizing browser caching. Also, the user will not realize the
resources are served dynamically and bookmarking is easy.
Constructor Summary | |
---|---|
IndexedSharedResourceCodingStrategy(String mountPath,
String resourceKey)
mount resource with specified key under indexed path |
Method Summary | |
---|---|
IRequestTarget |
decode(RequestParameters requestParameters)
Gets the decoded request target. |
protected ValueMap |
decodeParameters(String path,
Map<String,?> queryParameters)
Decodes parameters object from the provided url fragment |
CharSequence |
encode(IRequestTarget requestTarget)
Gets the encoded url for the provided request target. |
boolean |
matches(IRequestTarget requestTarget)
Gets whether this mounter is applicable for the provided request target. |
Methods inherited from class org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy |
---|
appendParameters, appendPathParameter, getMountPath, matches, urlDecode, urlDecodePathComponent, urlDecodeQueryComponent, urlEncode, urlEncodePathComponent, urlEncodeQueryComponent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexedSharedResourceCodingStrategy(String mountPath, String resourceKey)
mountPath
- path the resource will be mounted toresourceKey
- key of the resourceMethod Detail |
---|
public CharSequence encode(IRequestTarget requestTarget)
IRequestTargetUrlCodingStrategy
requestTarget
- the request target to encode
IRequestTargetUrlCodingStrategy.encode(org.apache.wicket.IRequestTarget)
public IRequestTarget decode(RequestParameters requestParameters)
IRequestTargetUrlCodingStrategy
requestParameters
- the request parameters
IRequestTargetUrlCodingStrategy.decode(org.apache.wicket.request.RequestParameters)
protected ValueMap decodeParameters(String path, Map<String,?> queryParameters)
AbstractRequestTargetUrlCodingStrategy
decodeParameters
in class AbstractRequestTargetUrlCodingStrategy
path
- fragment of the url after the decoded path and before the query stringqueryParameters
- query string parameters
AbstractRequestTargetUrlCodingStrategy.decodeParameters(java.lang.String,
java.util.Map)
public boolean matches(IRequestTarget requestTarget)
IRequestTargetUrlCodingStrategy
requestTarget
- the request target
IRequestTargetUrlCodingStrategy.matches(org.apache.wicket.IRequestTarget)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |