Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4079

Provide new HybridPageParametersEncoder class for backwards compatibility with pre 1.5.x Hybrid URL encoding

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.5.1
    • 1.5.1
    • wicket
    • None

    Description

      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

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            chrisc Chris Colman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: