Class RedirectRequestHandler
- java.lang.Object
-
- org.apache.wicket.request.http.handler.RedirectRequestHandler
-
- All Implemented Interfaces:
IRequestHandler
public class RedirectRequestHandler extends Object implements IRequestHandler
A request handler that redirects to the given url. the url should be one of the following:- Fully qualified "http://foo.com/bar"
- Relative to the Wicket filter/servlet, e.g. "?wicket:interface=foo", "mounted_page"
- Absolute within your web application's context root, e.g. "/foo.html"
- Author:
- igor.vaynberg, jcompagner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RedirectRequestHandler.Mode
-
Constructor Summary
Constructors Constructor Description RedirectRequestHandler(String redirectUrl)
RedirectRequestHandler(String redirectUrl, int status)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getRedirectUrl()
int
getStatus()
RedirectRequestHandler
mode(RedirectRequestHandler.Mode mode)
void
respond(IRequestCycle requestCycle)
Generates a response.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.request.IRequestHandler
detach
-
-
-
-
Constructor Detail
-
RedirectRequestHandler
public RedirectRequestHandler(String redirectUrl)
- Parameters:
redirectUrl
- URL to redirect to.
-
RedirectRequestHandler
public RedirectRequestHandler(String redirectUrl, int status)
- Parameters:
redirectUrl
- URL to redirect to.status
- 301 (Moved permanently) or 302 (Moved temporarily)
-
-
Method Detail
-
getRedirectUrl
public String getRedirectUrl()
- Returns:
- redirect url
-
getStatus
public int getStatus()
- Returns:
- http redirect status code
-
mode
public RedirectRequestHandler mode(RedirectRequestHandler.Mode mode)
-
respond
public void respond(IRequestCycle requestCycle)
Description copied from interface:IRequestHandler
Generates a response.- Specified by:
respond
in interfaceIRequestHandler
- Parameters:
requestCycle
- the current request cycle
-
-