Package org.kohsuke.stapler
Class ForwardToView
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.kohsuke.stapler.ForwardToView
-
- All Implemented Interfaces:
Serializable
,HttpResponse
public class ForwardToView extends RuntimeException implements HttpResponse
HttpResponse
that forwards to aRequestDispatcher
, such as a view. Extends fromRuntimeException
so that you can throw it.- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ForwardToView(Class c, String view)
ForwardToView(Object it, String view)
ForwardToView(javax.servlet.RequestDispatcher dispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateResponse(StaplerRequest req, StaplerResponse rsp, Object node)
ForwardToView
optional()
Make this forwarding optional.ForwardToView
with(String varName, Object value)
Forwards to the view with specified attributes exposed as a variable binding.ForwardToView
with(Map<String,?> attributes)
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
with
public ForwardToView with(String varName, Object value)
Forwards to the view with specified attributes exposed as a variable binding.
-
with
public ForwardToView with(Map<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, 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
-
-