Package io.undertow.server.handlers
Class RedirectHandler
- java.lang.Object
-
- io.undertow.server.handlers.RedirectHandler
-
- All Implemented Interfaces:
HttpHandler
public class RedirectHandler extends 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RedirectHandler.Builder
-
Constructor Summary
Constructors Constructor Description RedirectHandler(ExchangeAttribute attribute)
RedirectHandler(String location)
RedirectHandler(String location, ClassLoader classLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleRequest(HttpServerExchange exchange)
Handle the request.String
toString()
-
-
-
Constructor Detail
-
RedirectHandler
public RedirectHandler(String location)
-
RedirectHandler
public RedirectHandler(String location, ClassLoader classLoader)
-
RedirectHandler
public RedirectHandler(ExchangeAttribute attribute)
-
-
Method Detail
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws Exception
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
-