Class RedirectException

All Implemented Interfaces:
Serializable

public class RedirectException extends RuntimeException
Exception that will immediately send redirection headers.

Any remaining handlers will be skipped except for *after* filters.

See Also:
  • Constructor Details

    • RedirectException

      public RedirectException()
      Redirects to the current URL.
    • RedirectException

      public RedirectException(FlashMessage flashMessage)
      Redirects to the current URL with a Flash message.
    • RedirectException

      public RedirectException(FlashMessageLevel flashMessageType, String flashMessageTex)
      Redirects to the current URL with a Flash message.
    • RedirectException

      public RedirectException(FlashMessageLevel flashMessageType, String flashMessageTex, JsonObject flashMessageVariables)
      Redirects to the current URL with a Flash message.
    • RedirectException

      public RedirectException(String newUrl)
      Parameters:
      newUrl - The new route to redirect to (not permanently). This can be a full URL or a relative path (+ a potential queryString)
    • RedirectException

      public RedirectException(String newUrl, FlashMessage flashMessage)
      Redirect with a Flash message.
      Parameters:
      newUrl - The new route to redirect to (not permanently). This can be a full URL or a relative path (+ a potential queryString)
    • RedirectException

      public RedirectException(String newUrl, FlashMessageLevel flashMessageType, String flashMessageTex)
      Redirect with a Flash message.
      Parameters:
      newUrl - The new route to redirect to (not permanently). This can be a full URL or a relative path (+ a potential queryString)
    • RedirectException

      public RedirectException(String newUrl, FlashMessageLevel flashMessageType, String flashMessageTex, JsonObject flashMessageVariables)
      Redirect with a Flash message.
      Parameters:
      newUrl - The new route to redirect to (not permanently). This can be a full URL or a relative path (+ a potential queryString)
    • RedirectException

      public RedirectException(String newUrl, boolean redirectPermanently)
      Parameters:
      newUrl - The new route to redirect to. This can be a full URL or a relative path (+ a potential queryString)
      redirectPermanently - Is this a temporary or permanent redirection?
    • RedirectException

      public RedirectException(String newUrl, boolean redirectPermanently, FlashMessageLevel flashMessageType, String flashMessageTex)
      Redirect with a Flash message.
      Parameters:
      newUrl - The new route to redirect to (not permanently). This can be a full URL or a relative path (+ a potential queryString)
      redirectPermanently - Is this a temporary or permanent redirection?
    • RedirectException

      public RedirectException(String newUrl, boolean redirectPermanently, FlashMessageLevel flashMessageType, String flashMessageTex, JsonObject flashMessageVariables)
      Redirect with a Flash message.
      Parameters:
      newUrl - The new route to redirect to (not permanently). This can be a full URL or a relative path (+ a potential queryString)
      redirectPermanently - Is this a temporary or permanent redirection?
    • RedirectException

      protected RedirectException(String newUrl, boolean redirectPermanently, FlashMessage flashMessage, FlashMessageLevel flashMessageType, String flashMessageText, JsonObject flashMessageVariables)
      Parameters:
      newUrl - The new route to redirect to. This can be a full URL or a relative path (+ a potential queryString)
      redirectPermanently - Is this a temporary or permanent redirection?
      flashMessage - a Flash message to display on the target url?
  • Method Details

    • getNewUrl

      public String getNewUrl()
      The new route to redirect to. This can be a full URL or a relative path (+ a potential queryString)
    • isRedirectPermanently

      public boolean isRedirectPermanently()
      Is this a temporary or permanent redirection?
    • getFlashMessage

      public FlashMessage getFlashMessage()
      Can be null.
    • getFlashMessageType

      public FlashMessageLevel getFlashMessageType()
      Can be null.
    • getFlashMessageText

      public String getFlashMessageText()
      Can be null.
    • getFlashMessageVariables

      public JsonObject getFlashMessageVariables()
      Can be null.