|
28 | 28 | import com.opensymphony.xwork2.util.ClassLoaderUtil; |
29 | 29 | import com.opensymphony.xwork2.util.ValueStack; |
30 | 30 | import freemarker.cache.*; |
| 31 | +import freemarker.core.TemplateClassResolver; |
31 | 32 | import freemarker.ext.jsp.TaglibFactory; |
32 | 33 | import freemarker.ext.servlet.HttpRequestHashModel; |
33 | 34 | import freemarker.ext.servlet.HttpRequestParametersHashModel; |
@@ -318,16 +319,23 @@ protected Configuration createConfiguration(ServletContext servletContext) throw |
318 | 319 | configuration.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER); |
319 | 320 |
|
320 | 321 | if (mruMaxStrongSize > 0) { |
| 322 | + LOG.debug("Sets Configuration.CACHE_STORAGE_KEY to strong:{}", mruMaxStrongSize); |
321 | 323 | configuration.setSetting(Configuration.CACHE_STORAGE_KEY, "strong:" + mruMaxStrongSize); |
322 | 324 | } |
323 | 325 | if (templateUpdateDelay != null) { |
| 326 | + LOG.debug("Sets Configuration.TEMPLATE_UPDATE_DELAY_KEY to {}", templateUpdateDelay); |
324 | 327 | configuration.setSetting(Configuration.TEMPLATE_UPDATE_DELAY_KEY, templateUpdateDelay); |
325 | 328 | } |
326 | 329 | if (encoding != null) { |
| 330 | + LOG.debug("Sets DefaultEncoding to {}", encoding); |
327 | 331 | configuration.setDefaultEncoding(encoding); |
328 | 332 | } |
| 333 | + LOG.debug("Disabled localized lookups"); |
329 | 334 | configuration.setLocalizedLookup(false); |
| 335 | + LOG.debug("Enabled whitespace stripping"); |
330 | 336 | configuration.setWhitespaceStripping(true); |
| 337 | + LOG.debug("Sets NewBuiltinClassResolver to TemplateClassResolver.SAFER_RESOLVER"); |
| 338 | + configuration.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER); |
331 | 339 |
|
332 | 340 | return configuration; |
333 | 341 | } |
|
0 commit comments