Wicket
  1. Wicket
  2. WICKET-5203

Base url is incorrect for error dispatched pages

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.8.0
    • Fix Version/s: 6.9.0, 1.5.11, 7.0.0
    • Component/s: wicket
    • Labels:
      None

      Description

      The fix for https://issues.apache.org/jira/browse/WICKET-4387 includes the following code in org.apache.wicket.protocol.http.servlet.ServletWebRequest#ServletWebRequest(HttpServletRequest httpServletRequest, String filterPrefix, Url url):

      if (forwardAttributes != null || errorAttributes != null)
      {
      if (LOG.isDebugEnabled())
      {
      LOG.debug("Setting filterPrefix('{}') to '' because there is either an error or a forward. {}, {}",
      new Object[]

      {filterPrefix, forwardAttributes, errorAttributes}

      );
      }
      // the filter prefix is not needed when the current request is internal
      // see WICKET-4387
      this.filterPrefix = "";

      The filterPrefix is actually needed later when a request is made due to an error (e.g. 404):

      public Url getClientUrl()
      {
      if (errorAttributes != null && !Strings.isEmpty(errorAttributes.getRequestUri()))
      {
      String problematicURI = Url.parse(errorAttributes.getRequestUri(), getCharset())
      .toString();
      return getContextRelativeUrl(problematicURI, filterPrefix);

      With filterPrefix=="" the urls for any resources in the error page are wrong.

      1. quickstart.tgz
        21 kB
        Martin Grigorov

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Martin Grigorov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development