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

make client-side redirects easier by introducing RedirectException

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.19
    • 1.4.20
    • wicket
    • None

    Description

      In wicket 1.5 and 6.0 we have RestartResponseException with a redirect policy to enforce a client side redirect. In 1.4 we need the following code fragment:

      getRequestCycle().setRedirect(true)
      throw new RestartResponseException(page)

      Since client-side redirects to pages are very common I find it discouraging that wicket users have to get into some of the guts of request cycle just to understand the above fragment. Also client-side redirects will not work with page instances like here

      getRequestCycle().setRedirect(true)
      throw new RestartResponseException(new MyPage())

      By introducing RedirectException this very common use case will be a lot easier and more terse and though we want people to migrate to 1.5 or, even better, 6.0 it will not hurt to give some love to 1.4.

      Attachments

        Activity

          People

            pete Peter Ertl
            pete Peter Ertl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: