org.kohsuke.stapler
Class HttpRedirect

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.kohsuke.stapler.HttpRedirect
All Implemented Interfaces:
java.io.Serializable, HttpResponse

public final class HttpRedirect
extends java.lang.RuntimeException
implements HttpResponse

HttpResponse that dose HTTP 302 redirect. Extends from RuntimeException so that you can throw it.

Author:
Kohsuke Kawaguchi
See Also:
Serialized Form

Field Summary
static HttpResponse CONTEXT_ROOT
          Redirect to the context root
static HttpRedirect DOT
          Redirect to "."
 
Constructor Summary
HttpRedirect(java.lang.String url)
           
 
Method Summary
static HttpResponse fromContextPath(java.lang.String relative)
          Deprecated. Use HttpResponses.redirectViaContextPath(String).
 void generateResponse(StaplerRequest req, StaplerResponse rsp, java.lang.Object node)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DOT

public static HttpRedirect DOT
Redirect to "."


CONTEXT_ROOT

public static HttpResponse CONTEXT_ROOT
Redirect to the context root

Constructor Detail

HttpRedirect

public HttpRedirect(java.lang.String url)
Method Detail

generateResponse

public void generateResponse(StaplerRequest req,
                             StaplerResponse rsp,
                             java.lang.Object node)
                      throws java.io.IOException,
                             javax.servlet.ServletException
Specified by:
generateResponse in interface HttpResponse
node - The object whose "doXyz" method created this object.
Throws:
java.io.IOException
javax.servlet.ServletException

fromContextPath

public static HttpResponse fromContextPath(java.lang.String relative)
Deprecated. Use HttpResponses.redirectViaContextPath(String).

Parameters:
relative - The path relative to the context path. The context path + this value is sent to the user.


Copyright © 2011. All Rights Reserved.