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