[
https://issues.apache.org/jira/browse/WW-5850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lukasz Lenart updated WW-5850:
------------------------------
Description:
Struts has two mechanisms for keeping form state across several requests
(wizard-like flows): the {{scope}} interceptor ({{ScopeInterceptor}}) and the
{{scopedModelDriven}} interceptor. This ticket gives {{scopedModelDriven}} an
explicit flow lifecycle so it becomes a full alternative to {{scope}}.
User poll on the mailing list: "Is anyone using the scope interceptor?" (user@,
2026-10-09). One reply, describing a multi-page form flow, which this feature
covers.
h2. Proposal
A flow is a named set of actions sharing one model stored in the session. Each
action declares the flow name and its role, in {{struts.xml}} or with a
Convention annotation:
* *start* — exactly one per flow. Begins the flow. Whether it creates a new
model or picks up an existing one is configurable by the developer.
* *step* — any number. Requires a running flow and works on the stored model.
* *end* — any number. Requires a running flow; the model is removed from the
session after the action runs.
Behaviour:
* A step or end action requested with no running flow redirects to the flow's
start action.
* Multiple flows can be defined in one configuration, distinguished by name.
* One running flow per user per flow name.
* Flow definitions are validated at startup (one start, at least one end,
consistent model type).
h2. Planned sequence for ScopeInterceptor
* 7.6.0 — this ticket: the alternative ships. {{ScopeInterceptor}} is unchanged.
* 7.7.0 — deprecate {{ScopeInterceptor}}, with a migration note to declarative
flows.
* 8.0.0 — remove {{ScopeInterceptor}}.
h2. Out of scope
* Deprecating or changing {{ScopeInterceptor}}.
* Visualising flows (Config Browser plugin, IntelliJ IDEA plugin) — possible
follow-up.
* Independent concurrent runs of the same flow in one session (e.g. two browser
tabs).
* Application-scoped state.
A design document will be attached via the pull request.
was:
Struts has two mechanisms for keeping form state across several requests
(wizard-like flows): the {{scope}} interceptor ({{ScopeInterceptor}}) and the
{{scopedModelDriven}} interceptor. This ticket consolidates on
{{scopedModelDriven}} by giving it an explicit flow lifecycle, and deprecates
{{ScopeInterceptor}}.
User poll on the mailing list: "Is anyone using the scope interceptor?" (user@,
2026-10-09). One reply, describing a multi-page form flow, which this feature
covers.
h2. Proposal
A flow is a named set of actions sharing one model stored in the session. Each
action declares the flow name and its role, in {{struts.xml}} or with a
Convention annotation:
* *start* — exactly one per flow. Begins the flow. Whether it creates a new
model or picks up an existing one is configurable by the developer.
* *step* — any number. Requires a running flow and works on the stored model.
* *end* — any number. Requires a running flow; the model is removed from the
session after the action runs.
Behaviour:
* A step or end action requested with no running flow redirects to the flow's
start action.
* Multiple flows can be defined in one configuration, distinguished by name.
* One running flow per user per flow name.
* Flow definitions are validated at startup (one start, at least one end,
consistent model type).
h2. Deprecation
{{ScopeInterceptor}} is deprecated with {{@Deprecated(forRemoval = true)}},
with a migration note showing a {{scope}}-based flow rewritten as a declarative
flow. Removal is tracked separately.
h2. Out of scope
* Visualising flows (Config Browser plugin, IntelliJ IDEA plugin) — possible
follow-up.
* Independent concurrent runs of the same flow in one session (e.g. two browser
tabs).
* Application-scoped state.
A design document will be attached via the pull request.
> Add declarative multi-step flows to ScopedModelDriven
> -----------------------------------------------------
>
> Key: WW-5850
> URL: https://issues.apache.org/jira/browse/WW-5850
> Project: Struts 2
> Issue Type: New Feature
> Components: Core, Core Interceptors, Plugin - Convention
> Reporter: Lukasz Lenart
> Priority: Major
> Fix For: 7.6.0
>
>
> Struts has two mechanisms for keeping form state across several requests
> (wizard-like flows): the {{scope}} interceptor ({{ScopeInterceptor}}) and the
> {{scopedModelDriven}} interceptor. This ticket gives {{scopedModelDriven}} an
> explicit flow lifecycle so it becomes a full alternative to {{scope}}.
> User poll on the mailing list: "Is anyone using the scope interceptor?"
> (user@, 2026-10-09). One reply, describing a multi-page form flow, which this
> feature covers.
> h2. Proposal
> A flow is a named set of actions sharing one model stored in the session.
> Each action declares the flow name and its role, in {{struts.xml}} or with a
> Convention annotation:
> * *start* — exactly one per flow. Begins the flow. Whether it creates a new
> model or picks up an existing one is configurable by the developer.
> * *step* — any number. Requires a running flow and works on the stored model.
> * *end* — any number. Requires a running flow; the model is removed from the
> session after the action runs.
> Behaviour:
> * A step or end action requested with no running flow redirects to the flow's
> start action.
> * Multiple flows can be defined in one configuration, distinguished by name.
> * One running flow per user per flow name.
> * Flow definitions are validated at startup (one start, at least one end,
> consistent model type).
> h2. Planned sequence for ScopeInterceptor
> * 7.6.0 — this ticket: the alternative ships. {{ScopeInterceptor}} is
> unchanged.
> * 7.7.0 — deprecate {{ScopeInterceptor}}, with a migration note to
> declarative flows.
> * 8.0.0 — remove {{ScopeInterceptor}}.
> h2. Out of scope
> * Deprecating or changing {{ScopeInterceptor}}.
> * Visualising flows (Config Browser plugin, IntelliJ IDEA plugin) — possible
> follow-up.
> * Independent concurrent runs of the same flow in one session (e.g. two
> browser tabs).
> * Application-scoped state.
> A design document will be attached via the pull request.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)