/** * Create the template loader. The default implementation will create a {@link ClassTemplateLoader} if the template * path starts with {@code "class://"}, a {@link FileTemplateLoader} if the template path starts with * {@code "file://"}, and a {@link WebappTemplateLoader} otherwise. Also, if * {@link Configuration#Configuration(freemarker.template.Version) incompatible_improvements} is 2.3.22 or higher, * it will create a {@link MultiTemplateLoader} if the template path starts with {@code "["}. * * @param templatePath * the template path to create a loader for * @return a newly created template loader */ protected TemplateLoader createTemplateLoader(String templatePath) throws IOException { return InitParamParser.createTemplateLoader(templatePath, getConfiguration(), getClass(), getServletContext()); }
ServletContext servletContext = getServletContext(); try { logWarnOnObjectWrapperMismatch();
/** * Create the template loader. The default implementation will create a {@link ClassTemplateLoader} if the template * path starts with {@code "class://"}, a {@link FileTemplateLoader} if the template path starts with * {@code "file://"}, and a {@link WebappTemplateLoader} otherwise. Also, if * {@link Configuration#Configuration(freemarker.template.Version) incompatible_improvements} is 2.3.22 or higher, * it will create a {@link MultiTemplateLoader} if the template path starts with {@code "["}. * * @param templatePath * the template path to create a loader for * @return a newly created template loader */ protected TemplateLoader createTemplateLoader(String templatePath) throws IOException { return InitParamParser.createTemplateLoader(templatePath, getConfiguration(), getClass(), getServletContext()); }
/** * Create the template loader. The default implementation will create a {@link ClassTemplateLoader} if the template * path starts with {@code "class://"}, a {@link FileTemplateLoader} if the template path starts with * {@code "file://"}, and a {@link WebappTemplateLoader} otherwise. Also, if * {@link Configuration#Configuration(freemarker.template.Version) incompatible_improvements} is 2.3.22 or higher, * it will create a {@link MultiTemplateLoader} if the template path starts with {@code "["}. * * @param templatePath * the template path to create a loader for * @return a newly created template loader */ protected TemplateLoader createTemplateLoader(String templatePath) throws IOException { return InitParamParser.createTemplateLoader(templatePath, getConfiguration(), getClass(), getServletContext()); }
/** * Create the template loader. The default implementation will create a * {@link ClassTemplateLoader} if the template path starts with "class://", * a {@link FileTemplateLoader} if the template path starts with "file://", * and a {@link WebappTemplateLoader} otherwise. * @param templatePath the template path to create a loader for * @return a newly created template loader * @throws IOException */ protected TemplateLoader createTemplateLoader(String templatePath) throws IOException { if (templatePath.startsWith("class://")) { // substring(7) is intentional as we "reuse" the last slash return new ClassTemplateLoader(getClass(), templatePath.substring(7)); } else { if (templatePath.startsWith("file://")) { templatePath = templatePath.substring(7); return new FileTemplateLoader(new File(templatePath)); } else { return new WebappTemplateLoader(this.getServletContext(), templatePath); } } }
ServletContext servletContext = getServletContext(); try { TemplateModel model = createModel(wrapper, servletContext, request, response);
ServletContext servletContext = getServletContext(); try { logWarnOnObjectWrapperMismatch();
ServletContext servletContext = getServletContext(); try { logWarnOnObjectWrapperMismatch();