Class RedirectHandler

  • All Implemented Interfaces:
    HttpHandler

    public class RedirectHandler
    extends java.lang.Object
    implements HttpHandler
    A redirect handler that redirects to the specified location via a 302 redirect.

    The location is specified as an exchange attribute string.

    Author:
    Stuart Douglas
    See Also:
    ExchangeAttributes
    • Constructor Detail

      • RedirectHandler

        public RedirectHandler​(java.lang.String location)
      • RedirectHandler

        public RedirectHandler​(java.lang.String location,
                               java.lang.ClassLoader classLoader)
    • Method Detail

      • handleRequest

        public void handleRequest​(HttpServerExchange exchange)
                           throws java.lang.Exception
        Description copied from interface: HttpHandler
        Handle the request.
        Specified by:
        handleRequest in interface HttpHandler
        Parameters:
        exchange - the HTTP request/response exchange
        Throws:
        java.lang.Exception