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

UrlResourceReference generates broken relative URLs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 6.7.0
    • None
    • None

    Description

      I am trying to render a reference to a Javascript library which is stored somewhere in my webapp directory using UrlResourceReference:

      public void renderHead(IHeaderResponse response) {
      super.renderHead(response);
      response.render(JavaScriptHeaderItem.forReference(new UrlResourceReference(Url.parse("public/scripts/jquery-ui-1.8.6.custom.min.js")) .setContextRelative(true)));
      }

      This does not work, because our wicket servlet is using a prefix ("nui"), and thus the URL to the resource (corrently) contains ".." but this is escaped for some reason to "::".

      So the URL generated by the ResourceReference is e.g. "http://localhost:8080/app/nui/::/public/scripts/jquery-ui-1.8.6.custom.min.js" leading to a 404. The correct URL would be "http://localhost:8080/app/nui/../public/scripts/jquery-ui-1.8.6.custom.min.js" As far as I can see, ParentPathReferenceRewriter does the escaping.

      Attachments

        1. urlRenderInterface.patch
          5 kB
          Andrea Del Bene
        2. WICKET-4907.patch
          9 kB
          Martin Tzvetanov Grigorov

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            aka Andreas Kappler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: