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

Using setResponsePage() before page rendering should skip the rendering of the page

    XMLWordPrintableJSON

Details

    Description

      This ticket follows from the email thread http://markmail.org/thread/uk5y4ddoopntmkgd

      When setResponsePage() is used, the current page is still rendered. The response thus generated is then thrown away completely and a replacement request handler is used. I can think of 3 reasons why this should be avoided:
      1-Performance; it's wasteful to render components to discard them right away

      2-Needs complete components hierarchy; even if setResponsePage() is used in a page constructor (e.g. when redirecting depending on page parameters), since the page will be rendered, all of its components or some substitutes must be added to the page. Otherwise Wicket will throw a missing component exception in dev mode.

      3-Feedback messages; if the needlessly rendered page contains a feedback panel, feedback messages registered in the session will be swallowed by the thrown away page rendering.

      Attachments

        1. testCase.diff
          2 kB
          Andrea Del Bene
        2. WICKET-4636.diff
          3 kB
          Andrea Del Bene

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            berniegp Bertrand Guay-Paquet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: