ScriptRuntime runtime = templateContext.load( "templates/exception.jst");
runtime.addGlobalVariable( "request", request );
runtime.addGlobalVariable( "response", response );
runtime.addGlobalVariable( "servletContext", servletContext );
runtime.addVariable("ex", ex );
writeResponse( response, runtime.invoke() );
}
private ScriptRuntime initializeScript(String scriptName, HttpServletRequest request, HttpServletResponse response) throws IOException {
ScriptRuntime runtime = templateContext.load( scriptName );