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

interceptContinuationURL with umlauts not encoded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.5, 1.3.6, 1.4-RC1
    • 1.4-RC3
    • wicket
    • None

    Description

      This is my second try to fix Wicket's encoding of redirects to intercepted URLs.
      Instead of reopening WICKET-2007, I decided to create this new issue and make a clean start.

      When Wicket redirects to an intercept page, it stores the original URL in PageMap#interceptContinuationURL.
      // The intercept continuation URL should be saved exactly as the
      // original request specified.
      ...
      interceptContinuationURL = "/" + cycle.getRequest().getURL();

      Note that comment and code are not in sync:
      Instead of saving exactly the original request, a new URL is generated. ServletWebRequest#getURL() includes special characters non-encoded. Thus on a later continuation, the redirect to the original URL fails in case of special characters (umlauts in our case).

      We're now using a subclass of ServletWebRequest, which utilizes the requestURI:

      public String getURL()

      { // servletPath is de-encoded, so use requestURI minus contextPath instead // String url = getServletPath(); String url = httpServletRequest.getRequestURI().substring( httpServletRequest.getContextPath().length()); final String pathInfo = getHttpServletRequest().getPathInfo(); ... }

      I cannot say if this solution has unwanted side effects though.

      Attachments

        1. encodingtest.zip
          9 kB
          Sven Meier

        Activity

          People

            jdonnerstag Juegen Donnerstag
            svenmeier Sven Meier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: