/** * Create the instance of the freemarker Configuration object. * <p/> * this implementation * <ul> * <li>obtains the default configuration from Configuration.getDefaultConfiguration() * <li>sets up template loading from a ClassTemplateLoader and a WebappTemplateLoader * <li>sets up the object wrapper to be the BeansWrapper * <li>loads settings from the classpath file /freemarker.properties * </ul> * * @param servletContext */ protected freemarker.template.Configuration createConfiguration(ServletContext servletContext) throws TemplateException { freemarker.template.Configuration configuration = new freemarker.template.Configuration(); configuration.setTemplateLoader(getTemplateLoader(servletContext)); configuration.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER); configuration.setObjectWrapper(getObjectWrapper()); if (Configuration.isSet(WebWorkConstants.WEBWORK_I18N_ENCODING)) { configuration.setDefaultEncoding(Configuration.getString(WebWorkConstants.WEBWORK_I18N_ENCODING)); } loadSettings(servletContext, configuration); return configuration; }