org.kohsuke.stapler
Class ForwardToView

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

public class ForwardToView
extends java.lang.RuntimeException
implements HttpResponse

HttpResponse that forwards to a RequestDispatcher, such as a view. Extends from RuntimeException so that you can throw it.

Author:
Kohsuke Kawaguchi
See Also:
Serialized Form

Constructor Summary
ForwardToView(java.lang.Class c, java.lang.String view)
           
ForwardToView(java.lang.Object it, java.lang.String view)
           
ForwardToView(javax.servlet.RequestDispatcher dispatcher)
           
 
Method Summary
 void generateResponse(StaplerRequest req, StaplerResponse rsp, java.lang.Object node)
           
 ForwardToView optional()
          Make this forwarding optional.
 ForwardToView with(java.util.Map<java.lang.String,?> attributes)
           
 ForwardToView with(java.lang.String varName, java.lang.Object value)
          Forwards to the view with specified attributes exposed as a variable binding.
 
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
 

Constructor Detail

ForwardToView

public ForwardToView(javax.servlet.RequestDispatcher dispatcher)

ForwardToView

public ForwardToView(java.lang.Object it,
                     java.lang.String view)

ForwardToView

public ForwardToView(java.lang.Class c,
                     java.lang.String view)
Method Detail

with

public ForwardToView with(java.lang.String varName,
                          java.lang.Object value)
Forwards to the view with specified attributes exposed as a variable binding.


with

public ForwardToView with(java.util.Map<java.lang.String,?> attributes)

optional

public ForwardToView optional()
Make this forwarding optional. Render nothing if a view doesn't exist.


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


Copyright © 2012. All Rights Reserved.