01: /*
02: * @(#)getRequest.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 getRequest()
17: */
18: public class getRequest extends PnutsFunction {
19:
20: public getRequest() {
21: super ("getRequest");
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 (ServletRequest) context
32: .get(PnutsServlet.SERVLET_REQUEST);
33: } else {
34: undefined(args, context);
35: return null;
36: }
37: }
38:
39: public String toString() {
40: return "function getRequest()";
41: }
42: }
|