org.apache.wicket.request.target.basic
Class URIRequestTargetUrlCodingStrategy

java.lang.Object
  extended by org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy
      extended by org.apache.wicket.request.target.basic.URIRequestTargetUrlCodingStrategy
All Implemented Interfaces:
IMountableRequestTargetUrlCodingStrategy, IRequestTargetUrlCodingStrategy

public class URIRequestTargetUrlCodingStrategy
extends AbstractRequestTargetUrlCodingStrategy

Request coding strategy that uses a simple URI by putting the remaining path in the uri page parameter. Override the decode() method to return the appropriate request target, calling getURI(requestParameters) to get requested uri. Note that this request coding strategy takes other page parameters from the query string directly, it does not use hierarchical path for parameters.

Author:
Jean-Baptiste Quenot

Field Summary
protected static String URI
           
 
Constructor Summary
URIRequestTargetUrlCodingStrategy(String mountPath)
           
 
Method Summary
protected  void appendParameters(AppendingStringBuffer url, Map parameters)
          Gets the encoded URL for the request target.
 IRequestTarget decode(RequestParameters requestParameters)
          Does nothing
 PageParameters decodeParameters(RequestParameters requestParameters)
          Get the remaining path after mount point.
protected  ValueMap decodeParameters(String urlFragment, Map urlParameters)
          Decodes parameters object from the provided url fragment
 CharSequence encode(IRequestTarget requestTarget)
          Copied from BookmarkablePageRequestTargetUrlCodingStrategy.encode(IRequestTarget) without pageMapName field
protected  String getURI(RequestParameters requestParameters)
          Calls decodeParameters() and retrieves the uri parameter.
 boolean matches(IRequestTarget requestTarget)
          Always returns false
 
Methods inherited from class org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy
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
 

Field Detail

URI

protected static final String URI
See Also:
Constant Field Values
Constructor Detail

URIRequestTargetUrlCodingStrategy

public URIRequestTargetUrlCodingStrategy(String mountPath)
See Also:
AbstractRequestTargetUrlCodingStrategy.AbstractRequestTargetUrlCodingStrategy(String)
Method Detail

decodeParameters

public PageParameters decodeParameters(RequestParameters requestParameters)
Get the remaining path after mount point.

Parameters:
requestParameters - request parameters provided to the decode() method
Returns:
the URI

decode

public IRequestTarget decode(RequestParameters requestParameters)
Does nothing

Parameters:
requestParameters - the request parameters
Returns:
the decoded request target
See Also:
IRequestTargetUrlCodingStrategy.decode(org.apache.wicket.request.RequestParameters)

encode

public CharSequence encode(IRequestTarget requestTarget)
Copied from BookmarkablePageRequestTargetUrlCodingStrategy.encode(IRequestTarget) without pageMapName field

Parameters:
requestTarget - the request target to encode
Returns:
the encoded url
See Also:
IRequestTargetUrlCodingStrategy.encode(org.apache.wicket.IRequestTarget)

matches

public boolean matches(IRequestTarget requestTarget)
Always returns false

Parameters:
requestTarget - the request target
Returns:
whether this mounter is applicable for the provided request target
See Also:
IRequestTargetUrlCodingStrategy.matches(org.apache.wicket.IRequestTarget)

appendParameters

protected void appendParameters(AppendingStringBuffer url,
                                Map parameters)
Gets the encoded URL for the request target. The "uri" parameter is appended first with a slash, then the remaining parameters are handled like in QueryStringUrlCodingStrategy.appendParameters(org.apache.wicket.util.string.AppendingStringBuffer, java.util.Map)

Overrides:
appendParameters in class AbstractRequestTargetUrlCodingStrategy
Parameters:
url - the relative reference URL
parameters - parameter names mapped to parameter values

decodeParameters

protected ValueMap decodeParameters(String urlFragment,
                                    Map urlParameters)
Decodes parameters object from the provided url fragment

Overrides:
decodeParameters in class AbstractRequestTargetUrlCodingStrategy
Parameters:
urlFragment - fragment of the url after the decoded path and before the query string
urlParameters - query string parameters
Returns:
Parameters created from the url fragment and query string

getURI

protected String getURI(RequestParameters requestParameters)
Calls decodeParameters() and retrieves the uri parameter. If you need to access multiple parameters in the request, call decodeParameters(RequestParameters) directly.

NOTE. the returned URI is kept URL-encoded as per the HttpServletRequest.getRequestURI() specification

Parameters:
requestParameters -
Returns:


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