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 classRedirectHandler.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 voidhandleRequest(HttpServerExchange exchange)Handle the request.StringtoString()
-
-
-
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:HttpHandlerHandle the request.- Specified by:
handleRequestin interfaceHttpHandler- Parameters:
exchange- the HTTP request/response exchange- Throws:
Exception
-
-