Class RedirectException

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    RedirectException

    public class RedirectException
    extends RuntimeException
    Provides an redirect exception which can be used to redirect the user to another location.

    By convention if the redirect target URL is prefixed with '/' then the web applications context path will be prepended to the target URL. For example:

     '/form-expired.htm' -> 'http://www.mycorp.com/forms/form-expired.htm' 

    Note this URL context path pre-pending should be done by the calling code and will not be done by this class.

    See Also:
    Serialized Form
    • Constructor Detail

      • RedirectException

        public RedirectException​(String target)

        Create a Redirect exception with the given target URL.

        By convention if the redirect target URL is prefixed with '/' then the web applications context path will be prepended to the target URL. For example:

         '/form-expired.htm' -> 'http://www.mycorp.com/forms/form-expired.htm' 

        Note this URL context path pre-pending should be done by the calling code and will not be done by this class.

        Parameters:
        target - the redirect target URL
    • Method Detail

      • getTarget

        public String getTarget()
        Return the redirect target URL.
        Returns:
        the redirect target URL
      • toString

        public String toString()
        Overrides:
        toString in class Throwable
        Returns:
        the string representation of this object.