Class 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 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