KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > kohsuke > stapler > StaplerResponse


1 package org.kohsuke.stapler;
2
3 import javax.servlet.ServletException JavaDoc;
4 import javax.servlet.http.HttpServletResponse JavaDoc;
5 import java.io.IOException JavaDoc;
6 import java.net.URL JavaDoc;
7
8 /**
9  * Defines additional operations made available by Stapler.
10  *
11  * <p>
12  * Right now, there's none.
13  *
14  * @author Kohsuke Kawaguchi
15  */

16 public interface StaplerResponse extends HttpServletResponse JavaDoc {
17     /**
18      * Evaluates the url against the given object and
19      * forwards the request to the result.
20      *
21      * <p>
22      * This can be used for example inside an action method
23      * to forward a request to a JSP.
24      *
25      * @param it
26      * the URL is evaluated against this object. Must not be null.
27      * @param url
28      * the relative URL (e.g., "foo" or "foo/bar") to resolve
29      * against the "it" object.
30      * @param request
31      * Request to be forwarded.
32      */

33     void forward(Object JavaDoc it, String JavaDoc url, StaplerRequest request) throws ServletException JavaDoc, IOException JavaDoc;
34     /**
35      * Redirects the browser to where it came from (the referer.)
36      */

37     void forwardToPreviousPage(StaplerRequest request) throws ServletException JavaDoc, IOException JavaDoc;
38
39     /**
40      * Works like {@link #sendRedirect(String)} except that this method
41      * escapes the URL.
42      */

43     void sendRedirect2(String JavaDoc url) throws IOException JavaDoc;
44
45     /**
46      * Serves a static resource.
47      *
48      * <p>
49      * This method sets content type, HTTP status code, sends the complete data
50      * and closes the response. This method also handles cache-control HTTP headers
51      * like "If-Modified-Since" and others.
52      */

53     void serveFile(StaplerRequest request, URL JavaDoc res) throws ServletException JavaDoc, IOException JavaDoc;
54 }
55
Popular Tags