//#end
return super.get(key);
}
- public void put(Object key, Object val) throws JSExn {
+ public Object put(Object key, Object val) throws JSExn {
//#switch(JS.toString(key))
case "created": throw new JSExn("can not set session.created");
case "accessed": throw new JSExn("can not set session.accessed");
case "invalidate": throw new JSExn("can not set session.invalidate");
//#end
- super.put(key, val);
+ return super.put(key, val);
}
public Object callMethod(Object method, final Object a, final Object b, Object c, Object[] rest, int nargs)
throws JSExn {
private List keys = null;
public Object get(Object key) {
return request.getSession(true).getAttribute(JS.toString(key)); }
- public void put(Object key, Object val) {
+ public Object put(Object key, Object val) {
if (val == null) request.getSession(true).removeAttribute(JS.toString(key));
- else request.setAttribute(JS.toString(key), val); }
+ else request.setAttribute(JS.toString(key), val);
+ return null; }
public Collection keys() {
return keys == null ? keys = Collections.list(request.getSession(true).getAttributeNames()) : keys; }
};
return keys == null ? keys = Collections.list(request.getHeaderNames()) : keys; }
};
private JS responseHeader = new JS() {
- public void put(Object key, Object val) {
- response.setHeader(JS.toString(key), JS.toString(val)); }
+ public Object put(Object key, Object val) {
+ response.setHeader(JS.toString(key), JS.toString(val)); return null; }
};
private class Sub extends JS {
Object key;
Sub(Object key) { this.key = key; }
- public void put(Object key, Object val) throws JSExn {
- Scope.this.put(JS.toString(this.key) + "." + JS.toString(key), val); }
+ public Object put(Object key, Object val) throws JSExn {
+ return Scope.this.put(JS.toString(this.key) + "." + JS.toString(key), val); }
public Object get(Object key) throws JSExn {
return Scope.this.get(JS.toString(this.key) + "." + JS.toString(key)); }
public Object call(Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {
//#end
return null;
}
- public void put(Object key, Object val) throws JSExn {
+ public Object put(Object key, Object val) throws JSExn {
try {
//#switch(JS.toString(key))
case "response.code": response.setStatus(JS.toInt(val));
case "response.redirect": response.sendRedirect(JS.toString(val));
case "response.contentType": response.setContentType(JS.toString(val));
//#end
+ return null;
} catch (IOException e) {
throw new JSExn(e);
}