Lukasz Lenart created WW-5689:
---------------------------------

             Summary: Lean core: extract FreeMarker, tag library and JSP 
support into dedicated plugins
                 Key: WW-5689
                 URL: https://issues.apache.org/jira/browse/WW-5689
             Project: Struts 2
          Issue Type: Task
          Components: Core
            Reporter: Lukasz Lenart
             Fix For: 8.0.0


h2. Goal

Reduce {{struts2-core}} to routing, dispatch, the OGNL value stack and the 
interceptor/result machinery. View technologies become opt-in plugins, so a 
REST/JSON-only application carries no JSP, no tag library and no FreeMarker.

The default assembly still bundles all three, so the out-of-the-box 
distribution is unchanged for existing users — this is Ted Husted's "omnibus 
jar" answer from the original 2007 dev@ thread.

Supersedes WW-2278 (closed Won't Fix — "move the tags into a plugin" is not the 
change anyone would make today; see the triage comment there for the evidence).

Blocked by WW-4759. Its governing constraint applies here unchanged: OSGi 
{{Export-Package}} and the JPMS direction forbid split packages, so every 
module cut must be whole-package with FQCNs preserved, and the 
API/implementation de-mixing has to land first.

h2. Proposed modules
* {{struts2-freemarker-plugin}} — {{org.apache.struts2.views.freemarker}} 
(FreemarkerManager, FreemarkerResult, FreemarkerThemeTemplateLoader), 
{{components.template.FreemarkerTemplateEngine}}, and the FTL theme templates
* {{struts2-tags-plugin}} — {{org.apache.struts2.components}}, 
{{org.apache.struts2.views.jsp}} plus the generated 
{{META-INF/struts-tags.tld}}, {{org.apache.struts2.views.annotations}}
* {{struts2-jsp-plugin}} — {{components.template.JspTemplateEngine}}, 
{{JspSupportServlet}}, JSP-side template support

The tags/JSP boundary is genuinely fuzzy and needs a design decision rather 
than an assumption: the tag components are useless without some template engine 
behind them.

h2. Core decoupling that must happen first

Each of these is independently reviewable and can land in 7.x ahead of the 
module split. Together they are what actually makes FreeMarker optional — 
core's own dependency on it is three convenience pages.

h1. {{DefaultDispatcherErrorHandler}} renders the dev-mode error page through 
FreemarkerManager. It needs a template-free default.
h1. {{ExecuteAndWaitInterceptor}} defaults to FreemarkerResult for the wait 
page. The default must not hard-reference a view technology.
h1. {{DebuggingInterceptor}} imports FreemarkerResult and FreemarkerManager. 
Same treatment.
h1. Core extension points currently living in view packages must move to 
core-owned packages (WW-4759 step (i)): {{components.UrlRenderer}}, 
{{views.util.UrlHelper}}, {{components.date.DateFormatter}}, 
{{components.template.TemplateEngine}} and {{TemplateEngineManager}}, 
{{components.Component}}.
h1. {{StrutsBeanSelectionProvider}} and {{struts-beans.xml}} hard-register nine 
view beans. Those registrations move into each plugin's {{struts-plugin.xml}}.

h2. Compatibility

FQCNs preserved throughout; {{struts2-core}} must never depend on a plugin. 
Seven existing plugins import these packages and will need dependency updates: 
javatemplates, velocity, jasperreports7, jasperreports, tiles, convention, 
config-browser.

h2. Scope note

Major structural change, targeted for Struts 8.0.0, sequenced after WW-4759.



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

Reply via email to