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

Rendering of relative Urls does not take into account filterpath for absolute Urls

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 8.11.0
    • 9.4.0, 8.13.0
    • wicket
    • None

    Description

      Assume, there is an WicketApplication with mounted Page "error" running on https://localhost:8443/ 

      The page "error" renders an reference for resource "https://localhost:8443/webjars/uilib/5.6.0/javascripts/bundle.all.js". The rendered Url is created by Url.parse("https://localhost:8443/webjars/uilib/5.6.0/javascripts/bundle.all.js").

      In this case everything is fine:

      https://localhost:8443/error renders tag <script type="text/javascript" src="./webjars/uilib/5.6.0/javascripts/bundle.all.js"></script>

      But if I change the filterpath of the application to "recovery", the following happens:

      https://localhost:8443/recovery/error renders tag <script type="text/javascript" src=".//webjars/uilib/5.6.0/javascripts/bundle.all.js"></script>

      This is not the expected value "../webjars/uilib/5.6.0/javascripts/bundle.all.js" of the src-Attribute.

      I tried to break it down: The rendered Url in the script tag is created by the UrlRenderer. The UrlRenderer decides to render a relative url as scheme, host and port match the corresponding properties of the clientUrl and the Url is not "contextabsolute" (as it contains an hostname). I think, this is absolutly fine. But during rendering the relative url the UrlRenderer does not detect, that it has to handle this url separatly. The segments of the Url contain a leading "" (for /) which is not followed by the filterpath. I assume, this should be resolved to ".." for every part of the filterpath.

       

       

       

      Attachments

        1. wicket-6878.tgz
          5 kB
          Hans Schäfer

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            hosea Hans Schäfer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: