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

MockHttpServletRequest does not support absolute redirection URLs.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 1.4-M3
    • None
    • wicket
    • None

    Description

      Using the sendRedirect(String) method on an MockHttpServletRequest object causes bugged behaviour when the URL that is passed is absolute.

      The following code needs to change (line 1277):
      // We need to absolutize the redirect URL as we are not as smart as a web-browser
      // (WICKET-702)
      url = getContextPath() + getServletPath() + "/" + redirect;
      into, for example:
      // We need to absolutize the redirect URL as we are not as smart as a web-browser
      // (WICKET-702)
      url = redirect.charAt(0) == '/' ? redirect : redirect. getContextPath() + getServletPath() + "/" + redirect;

      After a few redirects I end up at:
      /BankApplication/BankApplication//BankApplication
      Which is not where I want to be.

      Attachments

        1. Wicket-Quickstart.zip
          87 kB
          Martin Terra

        Activity

          People

            ivaynberg Igor Vaynberg
            lhunath Maarten Billemont
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: