Package org.kohsuke.stapler
Class HttpRedirect
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.kohsuke.stapler.HttpRedirect
-
- All Implemented Interfaces:
Serializable
,HttpResponse
public final class HttpRedirect extends RuntimeException implements HttpResponse
HttpResponse
that dose HTTP 302 redirect. Extends fromRuntimeException
so that you can throw it.- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static HttpResponse
CONTEXT_ROOT
Redirect to the context rootstatic HttpRedirect
DOT
Redirect to "."
-
Constructor Summary
Constructors Constructor Description HttpRedirect(int statusCode, String url)
HttpRedirect(String url)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static HttpResponse
fromContextPath(String relative)
Deprecated.void
generateResponse(StaplerRequest req, StaplerResponse rsp, Object node)
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
DOT
public static final HttpRedirect DOT
Redirect to "."
-
CONTEXT_ROOT
public static HttpResponse CONTEXT_ROOT
Redirect to the context root
-
-
Method Detail
-
generateResponse
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, javax.servlet.ServletException
- Specified by:
generateResponse
in interfaceHttpResponse
node
- The object whose "doXyz" method created this object.- Throws:
IOException
javax.servlet.ServletException
-
fromContextPath
@Deprecated public static HttpResponse fromContextPath(String relative)
Deprecated.- Parameters:
relative
- The path relative to the context path. The context path + this value is sent to the user.
-
-