* (or if no SessionID variable was found) - initialize the interp
*/
String sessionId = request.props.getProperty("SessionID","common");
request.log(Server.LOG_DIAGNOSTIC, " Using session: " + sessionId);
Interp interp = (Interp) SessionManager.getSession(sessionId,
propsPrefix + "TCL", Interp.class);
int code = 0;
synchronized (interp) {
setupInterp(interp, sessionId);
try {
// System.out.println("running eval");
TclUtil.setVar(interp, "content", new String(content),
TCL.GLOBAL_ONLY);
interp.eval("filter" + " " +
ReflectObject.newInstance(interp, Request.class, request) +
" " + ReflectObject.newInstance(interp, MimeHeaders.class,
headers)
);
TclObject res = interp.getVar("content", TCL.GLOBAL_ONLY);
content = res.toString().getBytes();
} catch (TclException e) {
code = e.getCompletionCode();
String trace = e.toString();
// System.out.println("Tcl Oops: " + code + " " + e);
if (code == 1) {
try {
trace = interp.getVar("errorInfo", TCL.GLOBAL_ONLY).toString();
} catch (Exception e1) {}
}
request.log(Server.LOG_WARNING, propsPrefix + trace);
}
} // end sync block