code: protected Template getTemplate(File file) throws ServletException {
          String key = file.getAbsolutePath();
          Template template = findCachedTemplate(key, file);
  
          //
          // Template not cached or the source file changed - compile new template!
          //
          if (template == null) {
              try {
                  template = createAndStoreTemplate(key, new FileInputStream(file), file);
              } catch (Exception e) {
                  throw new ServletException("Creation of template failed: " + e, e);
              }
          }
  
          return template;
      }
docs: Gets the template created by the underlying engine parsing the request.
  
  <p>
  This method looks up a simple (weak) hash map for an existing template
  object that matches the source file. If the source file didn't change in
  length and its last modified stamp hasn't changed compared to a precompiled
  template object, this template is used. Otherwise, there is no or an
  invalid template object cache entry, a new one is created by the underlying
  template engine. This new instance is put to the cache for consecutive
  calls.
  
  @return The template that will produce the response text.
  @param file The file containing the template source.
  @throws ServletException If the request specified an invalid template source file