Set the data property in the response object (res) to a generic map

object.
This commit is contained in:
hns 2001-11-20 15:32:28 +00:00
parent fbe9f40631
commit 56e5201f8e

View file

@ -46,7 +46,9 @@ public class RequestEvaluator implements Runnable {
Object result; Object result;
Exception exception; Exception exception;
protected ArrayPrototype reqPath; protected ArrayPrototype reqPath;
private ESMapWrapper reqData; private ESMapWrapper reqData;
private ESMapWrapper resData;
// vars for FESI EcmaScript support // vars for FESI EcmaScript support
public Evaluator evaluator; public Evaluator evaluator;
@ -120,6 +122,7 @@ public class RequestEvaluator implements Runnable {
global.putHiddenProperty ("app", appnode); global.putHiddenProperty ("app", appnode);
reqPath = new ArrayPrototype (evaluator.getArrayPrototype(), evaluator); reqPath = new ArrayPrototype (evaluator.getArrayPrototype(), evaluator);
reqData = new ESMapWrapper (this); reqData = new ESMapWrapper (this);
resData = new ESMapWrapper (this);
} catch (Exception e) { } catch (Exception e) {
System.err.println("Cannot initialize interpreter"); System.err.println("Cannot initialize interpreter");
@ -199,9 +202,12 @@ public class RequestEvaluator implements Runnable {
} }
global.putHiddenProperty ("path", reqPath); global.putHiddenProperty ("path", reqPath);
global.putHiddenProperty ("app", appnode); global.putHiddenProperty ("app", appnode);
// set and mount the request data object
// set and mount the request and response data object
reqData.setData (req.getRequestData()); reqData.setData (req.getRequestData());
req.data = reqData; req.data = reqData;
resData.setData (new HashMap ());
res.data = resData;
try { try {
@ -437,6 +443,9 @@ public class RequestEvaluator implements Runnable {
global.deleteProperty ("path", "path".hashCode()); global.deleteProperty ("path", "path".hashCode());
global.putHiddenProperty ("app", appnode); global.putHiddenProperty ("app", appnode);
resData.setData (new HashMap ());
res.data = resData;
// convert arguments // convert arguments
int l = args.size (); int l = args.size ();
current = getElementWrapper (root); current = getElementWrapper (root);
@ -508,7 +517,10 @@ public class RequestEvaluator implements Runnable {
global.deleteProperty ("path", "path".hashCode()); global.deleteProperty ("path", "path".hashCode());
global.putHiddenProperty ("app", appnode); global.putHiddenProperty ("app", appnode);
if (current == null) { resData.setData (new HashMap ());
res.data = resData;
if (current == null) {
if (user == null) { if (user == null) {
current = global; current = global;
} else { } else {