01: /* RequestContext.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Thu Aug 30 12:32:50 2007, Created by tomyeh
10: }}IS_NOTE
11:
12: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.web.servlet.xel;
20:
21: import java.io.Writer;
22: import java.io.IOException;
23:
24: import javax.servlet.ServletContext;
25: import javax.servlet.ServletRequest;
26: import javax.servlet.ServletResponse;
27:
28: import org.zkoss.xel.VariableResolver;
29:
30: /**
31: * The context used to simplify the signatures of XEL function.
32: *
33: * <p>It is designed to make the signature of XEL functions
34: * (see {@link org.zkoss.web.fn.ServletFns}) simpler.
35: * For example, {@link org.zkoss.web.fn.ServletFns#isExplorer} requires
36: * no argument, since it assumes the current context can be retrieved
37: * from {@link RequestContexts#getCurrent}.
38: *
39: * @author tomyeh
40: * @since 3.0.0
41: */
42: public interface RequestContext {
43: /** Returns the writer, never null.
44: */
45: public Writer getOut() throws IOException;
46:
47: /** Returns the request, or null if not available.
48: */
49: public ServletRequest getRequest();
50:
51: /** Returns the response, or null if not available.
52: */
53: public ServletResponse getResponse();
54:
55: /** Returns the request, or null if not available.
56: */
57: public ServletContext getServletContext();
58:
59: /** Returns the variable resolver.
60: */
61: public VariableResolver getVariableResolver();
62: }
|