Wicket
  1. Wicket
  2. WICKET-3885

setResponsePage in AjaxLink goes always to localhost:8080 instead to the right host and port

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC5.1
    • Fix Version/s: 1.5-RC6
    • Component/s: wicket
    • Labels:
      None

      Description

      setResponsePage in an AjaxLink in Wicket 1.4 redirects with a relative path to the response page.
      Wicket 1.5 takes the absolute path "localhost:8080/path to the response page" even when the host and port are different.
      (e.g. with Apache2 a virtual host is created with server name www.mycompany.com, setResponce wil go to "localhost:8080/path to page" instead of "www.mycompany.com/path to page")

        Activity

        Hide
        Martin Grigorov added a comment -

        With
        =====================
        Revision 915613 - (view) (download) (annotate) - [select for diffs]
        Modified Wed Feb 24 00:21:13 2010 UTC (16 months, 2 weeks ago) by knopp
        Original Path: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebResponse.java
        File length: 5846 byte(s)
        Diff to previous 912510 (colored)
        RestartResponseOnInterceptPageException
        Upgraded jetty
        =====================

        org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String) have been changed to produce absolute url.
        Commenting "url = getAbsoluteURL(url);" (line 244, in current trunk) fixes the problem. No tests fail.
        By Servlet spec javax.servlet.http.HttpServletResponse.sendRedirect(String) should resolve any relative url passed to it.
        For Ajax requests we return "<ajax-response><redirect><![CDATA[THE URL HERE]]></redirect></ajax-response>" and it works OK again.
        I see no reason for this "getAbsoluteURL(url)" call.

        Show
        Martin Grigorov added a comment - With ===================== Revision 915613 - (view) (download) (annotate) - [select for diffs] Modified Wed Feb 24 00:21:13 2010 UTC (16 months, 2 weeks ago) by knopp Original Path: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebResponse.java File length: 5846 byte(s) Diff to previous 912510 (colored) RestartResponseOnInterceptPageException Upgraded jetty ===================== org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String) have been changed to produce absolute url. Commenting "url = getAbsoluteURL(url);" (line 244, in current trunk) fixes the problem. No tests fail. By Servlet spec javax.servlet.http.HttpServletResponse.sendRedirect(String) should resolve any relative url passed to it. For Ajax requests we return "<ajax-response><redirect><![CDATA [THE URL HERE] ]></redirect></ajax-response>" and it works OK again. I see no reason for this "getAbsoluteURL(url)" call.
        Hide
        Igor Vaynberg added a comment -

        yes, seems weird indeed

        Show
        Igor Vaynberg added a comment - yes, seems weird indeed

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Alain Sillen
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development