Provide new HybridPageParametersEncoder class for backwards compatibility with
pre 1.5.x Hybrid URL encoding
------------------------------------------------------------------------------------------------------------
Key: WICKET-4079
URL: https://issues.apache.org/jira/browse/WICKET-4079
Project: Wicket
Issue Type: Improvement
Components: wicket
Affects Versions: 1.5.1
Reporter: Chris Colman
Priority: Minor
Any 1.4 app that has been live for a while would likely have a collection of
links pointing to it from external sites on the web. You really want the Wicket
1.5 version of your app to be able to handle any existing hybrid style links
without generating an error.
The links are in the style:
/myPage/paramName1/paramValue1/paramName2/paramValue2
When migrating to 1.5, without a 1.4 compatible IPageParametersEncoder
implementation, you need to include the full parameter specification in every
mount if you want to avoid making changes to each individual Page class that
reads parameters. The attached IPageParametersEncoder implementation means that
is no longer necessary. All that is needed is to mount your pages as follows:
mount(new MountedMapper("/myPage/", MyPage.class, new
HybridPageParametersEncoder());
I'm submitting this .java file as a patch so that hopefully it may be included
in future 1.5.x versions of Wicket to make it easy to implement backwards
compatible URL parameter encoding for other 1.4 migrators.
This code is based on a suggestion by luniv on StackOverflow here:
http://stackoverflow.com/questions/6154430/how-do-i-mimic-hybridurlcodingstrategy-in-wicket-1-5
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira