org.appng.core

## Class Redirect

- java.lang.Object
- - org.appng.core.Redirect

-     public class Redirect
      extends Object

  Utility class for sending HTTP redirects to a `HttpServletResponse`. See RFC 2616 for further details.
  Author:
    Matthias Müller, Matthias Herlitzius
  See Also:
    `HttpServletResponse.SC_MOVED_PERMANENTLY`, `HttpServletResponse.SC_FOUND`, `HttpServletResponse.SC_SEE_OTHER`, `HttpServletResponse.SC_TEMPORARY_REDIRECT`

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `to(javax.servlet.http.HttpServletResponse response, Integer statusCode, String target)` Sends a redirect with the given `statusCode` and `target` to a `HttpServletResponse`.
    `static void` | `to(javax.servlet.http.HttpServletResponse response, Integer statusCode, String origin, String target)` Sends a redirect with the given `statusCode` and `target` to a `HttpServletResponse`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### to

          public static void to(javax.servlet.http.HttpServletResponse response,
                                Integer statusCode,
                                String target)

      Sends a redirect with the given `statusCode` and `target` to a `HttpServletResponse`.
      Parameters:
        `response` - the response
        `statusCode` - the HTTP status-code
        `target` - the redirect target

    - #### to

          public static void to(javax.servlet.http.HttpServletResponse response,
                                Integer statusCode,
                                String origin,
                                String target)

      Sends a redirect with the given `statusCode` and `target` to a `HttpServletResponse`.
      Parameters:
        `response` - the response
        `statusCode` - the HTTP status-code
        `origin` - the (optional) origin of the request, only used for logging
        `target` - the redirect target

Copyright © 2011–2023 aiticon GmbH. All rights reserved.