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

UrlRenderer produces wrong full urls when the passed parameter is not absolute (as Url understands 'absolute')

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.5
    • 1.5.6, 6.0.0-beta2
    • wicket
    • None

    Description

      Code like:

      Url baseUrl = Url.parse("one/two/three");
      baseUrl.setProtocol("http");
      baseUrl.setHost("www.example.com");
      baseUrl.setPort(8888);
      UrlRenderer renderer = new UrlRenderer(new MockWebRequest(baseUrl));
      renderer.setBaseUrl(baseUrl); // this is needed because MockWebRequest cuts data
      String fullUrl = renderer.renderFullUrl(Url.parse("../four"));

      Produces url: http://www.example.com/../four while it has to be http://www.example.com/one/four

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              mgrigorov Martin Tzvetanov Grigorov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: