public class RhinoRuntime {
private static final Logger logger = Logger.getLogger("net.sf.sahi.command.RhinoRuntime");
public HttpResponse eval(final HttpRequest request){
Session session = request.session();
String toEval = request.getParameter("toEval");
ScriptRunner scriptRunner = session.getScriptRunner();
String result = "null";
if (scriptRunner instanceof RhinoScriptRunner){
RhinoScriptRunner rsr = (RhinoScriptRunner) session.getScriptRunner();
toEval = SahiScript.modifyFunctionNames(toEval);
result = rsr.eval(toEval);
} else {
logger.warning("Should not have come here: RhinoRuntime.eval: " + toEval);
}