- Console cons = new Console();
- Interpreter ip = new Interpreter(cons);
- Object resp;
- try {
- ip.set("req", req);
- resp = ip.eval(cmd);
- out.println("<pre>");
- out.println(Misc.htmlq((resp == null)?"(null)":(resp.toString())));
- out.println("</pre>");
- } catch(bsh.EvalError exc) {
- out.println("<h2>Evaluation error</h2>");
- out.println("<pre>");
- out.print(exc.toString());
- out.println("</pre>");
- if(exc instanceof bsh.TargetError) {
- bsh.TargetError te = (bsh.TargetError)exc;
- out.println("<h3>Target error</h3>");
+ String eo, ee;
+ synchronized(cons) {
+ cons.reset();
+ Object resp;
+ try {
+ ip.set("req", req);
+ resp = ip.eval(cmd);
+ out.println("<pre>");
+ out.println(Misc.htmlq((resp == null)?"(null)":(resp.toString())));
+ out.println("</pre>");
+ } catch(bsh.EvalError exc) {
+ out.println("<h2>Evaluation error</h2>");