- /** lets us put multi-level get/put/call keys all in the same method */
- private class Sub extends JS {
- Object key;
- Sub(Object key) { this.key = key; }
- public void put(Object key, Object val) throws JSExn {
- ServletScope.this.put(JS.toString(this.key) + "." + JS.toString(key), val); }
- public Object get(Object key) throws JSExn {
- return ServletScope.this.get(JS.toString(this.key) + "." + JS.toString(key)); }
- public Object call(Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {
- return ServletScope.this.callMethod(this.key, a0, a1, a2, rest, nargs);
- }
- public Object callMethod(Object method, Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {
- return ServletScope.this.callMethod(JS.toString(this.key) + "."
- + JS.toString(method), a0, a1, a2, rest, nargs);
- }
- }
- private Sub getSub(String key) { return new Sub(key); }
+ // FIXME: setattributes
+ //#repeat params/cookies/requestHeader/attributes \
+ // getParameter/getCookie/getHeader/getAttribute \
+ // getParameterNames/getCookieNames/getHeaderNames/getAttributeNames \
+ // request/request/request/session/response \
+ // setParameter/setCookie/setHeader/setAttribute
+ private JS params = new JS.Obj() {
+ public JS get(JS key) throws JSExn { return JSU.S(request.getParameter(JSU.toString(key)).toString()); }
+ public void put(JS key, JS val) throws JSExn { request.setParameter(JSU.toString(key), JSU.toString(val)); }
+ public Enumeration keys() throws JSExn {
+ return new JS.Enumeration.JavaStringEnumeration(request.getParameterNames()); }
+ };
+ //#end