org.apache.wicket.request
Interface IRequestCodingStrategy

All Superinterfaces:
IRequestTargetMounter
All Known Implementing Classes:
CryptedUrlWebRequestCodingStrategy, UrlCompressingWebCodingStrategy, WebRequestCodingStrategy

public interface IRequestCodingStrategy
extends IRequestTargetMounter

Implementations of this interface are responsible for digesting the incoming request and creating a suitable RequestParameters object for it, as well as creating url representations for request targets.

Author:
Eelco Hillenius

Method Summary
 RequestParameters decode(Request request)
          Analyze the request and create a corresponding request parameters object for it.
 CharSequence encode(RequestCycle requestCycle, IRequestTarget requestTarget)
           Gets the url that will point to the provided request target.
 String rewriteStaticRelativeUrl(String string)
          Rewrites relative paths found in static markup attributes (src,href,background) of wicket pages.
 
Methods inherited from interface org.apache.wicket.request.IRequestTargetMounter
addIgnoreMountPath, mount, pathForTarget, targetForRequest, unmount, urlCodingStrategyForPath
 

Method Detail

decode

RequestParameters decode(Request request)
Analyze the request and create a corresponding request parameters object for it.

Parameters:
request - the incoming request
Returns:
a request parameters object that corresponds to the request

encode

CharSequence encode(RequestCycle requestCycle,
                    IRequestTarget requestTarget)

Gets the url that will point to the provided request target.

If an implementation supports mounting, it should return the mounted path for the provided request target if any.

Parameters:
requestCycle - the current request cycle (for efficient access)
requestTarget - the request target
Returns:
the url to the provided target

rewriteStaticRelativeUrl

String rewriteStaticRelativeUrl(String string)
Rewrites relative paths found in static markup attributes (src,href,background) of wicket pages. Since we do not know the url depth at which the page will be rendered the implementations should usually simply append a prefix, eg ../../, to make the path context-relative. If the url is not relative it is returned intact. Implementations can be as simple as delegating to UrlUtils.rewriteToContextRelative(String, Request)

Parameters:
string -
Returns:
rewritten path
See Also:
Request.getRelativePathPrefixToContextRoot(), UrlUtils.rewriteToContextRelative(String, Request)


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.