Lukasz Lenart created WW-5691:
---------------------------------
Summary: Remove core's FreeMarker dependency from
ExecuteAndWaitInterceptor's fallback wait page
Key: WW-5691
URL: https://issues.apache.org/jira/browse/WW-5691
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
When an action is still running and the package defines no {{wait}} result,
{{ExecuteAndWaitInterceptor}} builds one itself:
{code}FreemarkerResult waitResult = new FreemarkerResult();
container.inject(waitResult);
waitResult.setLocation("/org/apache/struts2/interceptor/wait.ftl");
waitResult.execute(actionInvocation);
{code}
This dates to WW-3068 — the configuration became unmodifiable, so the earlier
trick of registering a fake {{wait}} result was no longer possible and the
interceptor started instantiating the result directly. The consequence is a
hard {{import org.apache.struts2.views.freemarker.FreemarkerResult}} in an
interceptor that has nothing to do with the view layer.
h2. Proposal
The built-in fallback wait page must not hard-reference a view technology.
# Introduce a small pluggable strategy for rendering the fallback wait page,
defaulting to a template-free renderer that emits the same meta-refresh markup
{{wait.ftl}} produces today.
# Keep the FreeMarker path available as an alternative implementation for
anyone who has overridden {{wait.ftl}}.
An application that defines its own {{wait}} result is unaffected either way —
that path never reaches this code.
h2. Compatibility
{{wait.ftl}} is internal. Behaviour of the rendered page (meta refresh, delay,
title) must stay identical; worth a test that pins the emitted markup before
the swap.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)