01: /*
02: * @(#)getResponse.java 1.2 04/12/06
03: *
04: * Copyright (c) 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package org.pnuts.servlet;
10:
11: import pnuts.servlet.*;
12: import pnuts.lang.*;
13: import javax.servlet.*;
14:
15: /*
16: * function getResponse()
17: */
18: public class getResponse extends PnutsFunction {
19:
20: public getResponse() {
21: super ("getResponse");
22: }
23:
24: public boolean defined(int nargs) {
25: return (nargs == 0);
26: }
27:
28: protected Object exec(Object args[], Context context) {
29: int nargs = args.length;
30: if (nargs == 0) {
31: return (ServletResponse) context
32: .get(PnutsServlet.SERVLET_RESPONSE);
33: } else {
34: undefined(args, context);
35: return null;
36: }
37: }
38:
39: public String toString() {
40: return "function getResponse()";
41: }
42: }
|