code: protected TemplateEngine initTemplateEngine(ServletConfig config) {
          String name = config.getInitParameter("template.engine");
          if (name == null) {
              return new SimpleTemplateEngine();
          }
          try {
              return (TemplateEngine) Class.forName(name).newInstance();
          } catch (InstantiationException e) {
              log("Could not instantiate template engine: " + name, e);
          } catch (IllegalAccessException e) {
              log("Could not access template engine class: " + name, e);
          } catch (ClassNotFoundException e) {
              log("Could not find template engine class: " + name, e);
          }
          return null;
      }
docs: Creates the template engine.
  <p>
  Called by {@link TemplateServlet#init(ServletConfig)} and returns just
  <code>new groovy.text.SimpleTemplateEngine()</code> if the init parameter
  <code>template.engine</code> is not set by the container configuration.
  
  @param config Current servlet configuration passed by the container.
  @return The underlying template engine or <code>null</code> on error.