Lukasz Lenart created WW-5692:
---------------------------------

             Summary: Remove core's FreeMarker dependency from 
DebuggingInterceptor
                 Key: WW-5692
                 URL: https://issues.apache.org/jira/browse/WW-5692
             Project: Struts 2
          Issue Type: Task
          Components: Core
            Reporter: Lukasz Lenart
             Fix For: 7.4.0


Part of the WW-5689 lean-core work, but self-contained and shippable in 7.x. 
See WW-5690 for the shared scope note — this concerns _core's own_ FreeMarker 
dependency only; tag-library users still require FreeMarker via the default FTL 
themes.

h2. Current behaviour

{{DebuggingInterceptor}} holds an injected {{FreemarkerManager}} and constructs 
{{FreemarkerResult}} directly in two places to render its diagnostic pages:
* the {{console}} mode, rendering 
{{/org/apache/struts2/interceptor/debugging/console.ftl}}
* the {{browser}} mode, rendering 
{{/org/apache/struts2/interceptor/debugging/browser.ftl}}

This is the third and last hard {{views.freemarker}} import left in core 
outside the view packages, after WW-5690 and WW-5691.

h2. Proposal

Same treatment as the other two: render the debug pages without instantiating a 
{{FreemarkerResult}}, keeping the output identical.

Worth considering as an alternative: this interceptor is a devMode-only 
diagnostic tool and is arguably a plugin in its own right. Moving it out of 
core wholesale would resolve the dependency without rewriting the templates, 
and fits the WW-5689 direction. That is the larger change though — for 7.x, 
removing the hard dependency in place is the safer scope, and the decision can 
be revisited for 8.0.0.

h2. Compatibility

Both templates are internal. {{struts.devMode}} gates the whole interceptor, so 
no production path is affected.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to