The following code allows the servlet attribute "engine" to be set by any request, which is not thread-safe.
if (state.useRenderers() && !prevRendering)
engine = new Engine(templateDir);
This code can be removed, as the value of "engine" is set in the servlet init() method.