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

RequestCycle urlFor ignores existing parameters when appending provided params

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.0
    • 1.4.2, 1.5-M1
    • wicket
    • None
    • macosx 10.5.7, wicket 1.4.0

    Description

      Link with listener and non empty parameters, built in the following fashion: getRequestCycle().urlFor(this, ILinkListener.INTERFACE, parameters) isn't formed correctly.

      at RequestCycle 947:
      AppendingStringBuffer buff = new AppendingStringBuffer(url);
      WebRequestEncoder encoder = new WebRequestEncoder(buff);

      This WebRequestEncoder doesn't check, if the parameters are already present in the url provided.

      In my case, the url from CharSequence url = encodeUrlFor(target); is already similar to: ?wicket:interface=:2:admin:container:tabbedPanel:panel:apartments:0:apartmentAddressEditLink:1:ILinkListener::

      What WebRequestEncoder does when appending parameters provided explicitly - it simply appends "?" mark and then the parameters list.

      So resulting url is incorrect and doesn't work:
      ?wicket:interface=:2:admin:container:tabbedPanel:panel:apartments:0:apartmentAddressEditLink:1:ILinkListener::?height=300&width=300

      (notice leading ?height=300&width=300).

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            cvl Vytautas Civilis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: