Class UrlPathPageParametersEncoder
- java.lang.Object
-
- org.apache.wicket.request.mapper.parameter.UrlPathPageParametersEncoder
-
- All Implemented Interfaces:
IPageParametersEncoder
public class UrlPathPageParametersEncoder extends Object implements IPageParametersEncoder
Encodes page parameters into Url path fragments instead of the query string like the default
Note: Because of the nature of the encoder it doesn't support POST request parameters.PageParametersEncoder
. The parameters are encoded in the following format:/param1Name/param1Value/param2Name/param2Value
.This used to be the default way of encoding page parameters in 1.4.x applications. Newer 1.5.x+ applications use the query string, by default. This class facilitates backwards compatibility and migrations of 1.4.x application to 1.5.x+ codebase.
Example usage:
mount(new MountedMapper("/myPage", MyPage.class, new UrlPathPageParametersEncoder()));
- Author:
- Chris Colman, James Gilbertson, ivaynberg
-
-
Constructor Summary
Constructors Constructor Description UrlPathPageParametersEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageParameters
decodePageParameters(Url url)
Decodes the given URL toPageParameters
.Url
encodePageParameters(PageParameters params)
Encode the givenPageParameters
instance into URL.
-
-
-
Constructor Detail
-
UrlPathPageParametersEncoder
public UrlPathPageParametersEncoder()
-
-
Method Detail
-
encodePageParameters
public Url encodePageParameters(PageParameters params)
Description copied from interface:IPageParametersEncoder
Encode the givenPageParameters
instance into URL. The URL will be then merged with the URL generated forIRequestHandler
.- Specified by:
encodePageParameters
in interfaceIPageParametersEncoder
- Parameters:
params
- parameters to encode- Returns:
- Url generated from the page parameters
-
decodePageParameters
public PageParameters decodePageParameters(Url url)
Description copied from interface:IPageParametersEncoder
Decodes the given URL toPageParameters
. The URL will have allIRequestHandler
specified segments/parameters stripped.- Specified by:
decodePageParameters
in interfaceIPageParametersEncoder
- Parameters:
url
- url to decode- Returns:
PageParameters
instance ornull
if empty
-
-