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

WebRequestCodingStrategy assumes that a shared resource URL should always be relative to the Wicket handler

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.4.4, 1.5-M1
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Windows XP Pro, OSGi, Eclipse 3.5, Java 5

      Description

      We use an absolute URL for the shared resources and as long as the page is directly under the Servlet context we have no problems, but for pages that have additional paths, then it is converted into a bad relative URL. For Example:

      /cjs/app/test.page - This page's shared resource URLs are not modified, so http://localhost:8080/crtv/css/cjs-3.3.1B.css is correct

      /cjs/app/orders/contentbuilder.page - This page's shared resource URLs are all modified causing them to be ../http://localhost:8080/crtv/css/cjs-3.3.1B.css, which is bad; and of course with JavaScript it causes us a lot of problems

      I propose a simple fix in method: public final CharSequence encode(final RequestCycle requestCycle, final IRequestTarget requestTarget)

      Change the following line from:

      if (!sharedResourceURL && portletRequest)

      To:

      if (url.toString().startsWith("http://") || url.toString().startsWith("https://") || (!sharedResourceURL && portletRequest))

      Thanks!

        Attachments

          Activity

            People

            • Assignee:
              ivaynberg Igor Vaynberg
              Reporter:
              eric.glass@courtview.com Eric Glass
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: