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

Wrong static resource urls when their generation is triggered by <wicket:link>

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 9.12.0
    • 9.19.0, 10.3.0
    • wicket
    • None

    Description

      If an application uses <wicket:link> to generate a url for a static resource, e.g.

      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/">
      <head>
      <wicket:head>
        <wicket:link>
          <link rel="stylesheet" type="text/css" href="css/test2.css"  />
        </wicket:link>
      </wicket:head>
      </head>
      ...  

      then during the page render time it will use

      CharSequence url = getRequestCycle().urlFor(handler); 

      and https://github.com/apache/wicket/blob/bc70f127ff74f154890a35be906b55db5bdc8683/wicket-core/src/main/java/org/apache/wicket/request/resource/PackageResourceReference.java#L117-L128 will use the current page's url and try to parse locale/style/variation from it and embed it in the static resource url.

      The problem is that it uses the pageId/renderCount/behaviorId and component path instead.

      Attachments

        1. wicket-link-leak.tgz
          28 kB
          Martin Tzvetanov Grigorov

        Activity

          People

            pedrosans Pedro Santos
            mgrigorov Martin Tzvetanov Grigorov
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: