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

render_to_buffer does not work for absolute URLs (with patch)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4-RC1
    • 1.4.10, 1.5-M1
    • wicket
    • None

    Description

      After installing a WebRequest instance that makes all URLs absolute, render_to_buffer does not work anymore. The problem is that WicketFilter assumes that all URLs are relative (WebFilter#getRelativePath removes the first char of the URL).

      Proposed fixes:
      1 in WebApplication#addBufferedResponse remove the leading "/" from the buffer id when present
      2 or alternatively, remove the leading "/" from the URL (when present) in WebRequestCycle, just before addBudderedResponse is called

      Here is the installed AbsoluteServletWebRequest:

      /**

      • WebServletRequest that makes bookmarkable links absolute.
      • Note: use this only when WickterFilter listens on the root context.
        *
      • @author Erik van Oosten
        */
        public class AbsoluteServletWebRequest extends ServletWebRequest {

      public AbsoluteServletWebRequest(HttpServletRequest servletRequest)

      { super(servletRequest); }

      @Override
      public int getDepthRelativeToWicketHandler()

      { return 0; }

      @Override
      public String getRelativePathPrefixToWicketHandler()

      { return "/"; }

      @Override
      public String getRelativePathPrefixToContextRoot() { return "/"; }

      }

      Attachments

        1. WICKET-1974.patch
          0.6 kB
          Erik van Oosten

        Activity

          People

            jdonnerstag Juegen Donnerstag
            erikvanoosten Erik van Oosten
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: