This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/struts.git
The following commit(s) were added to refs/heads/main by this push:
new 98fb891aa WW-5707 chore(core): deprecate legacy restful and restful2
action mappers (#1882)
98fb891aa is described below
commit 98fb891aac36b338d054425be129f3cd8ddd7fe9
Author: Lukasz Lenart <[email protected]>
AuthorDate: Mon Aug 31 20:04:50 2026 +0200
WW-5707 chore(core): deprecate legacy restful and restful2 action mappers
(#1882)
The core restful (RestfulActionMapper) and restful2 (Restful2ActionMapper)
mappers predate the Struts REST plugin, which is the maintained way to build
REST-style applications. Mark both classes @Deprecated(forRemoval = true)
and
point their javadoc to the REST plugin; removal is tracked as WW-5708.
Fixes: https://issues.apache.org/jira/browse/WW-5707
Claude-Session: https://claude.ai/code/session_016XMyQ1CRuYZkqygmD4aGHv
Co-authored-by: Claude Opus 4.8 <[email protected]>
---
.../org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java | 4 ++++
.../org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java | 4 ++++
core/src/main/resources/struts-beans.xml | 2 ++
3 files changed, 10 insertions(+)
diff --git
a/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java
b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java
index 988c23943..d0332c301 100644
---
a/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java
+++
b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java
@@ -33,7 +33,11 @@ import java.util.StringTokenizer;
/**
* Extended version of {@link RestfulActionMapper}, see documentation for more
details
* <a
href="https://struts.apache.org/core-developers/restful-action-mapper.html">Restful2ActionMapper</a>
+ *
+ * @deprecated since 7.4.0, this legacy mapper predates the Struts REST
plugin, which is the maintained
+ * way to build REST-style applications with Struts. Scheduled for removal in
the next major release.
*/
+@Deprecated(forRemoval = true)
public class Restful2ActionMapper extends DefaultActionMapper {
private static final Logger LOG =
LogManager.getLogger(Restful2ActionMapper.class);
diff --git
a/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java
b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java
index 92307d691..a9a929592 100644
---
a/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java
+++
b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java
@@ -36,7 +36,11 @@ import java.util.regex.Pattern;
* Simple Restfull Action Mapper to support REST application
* See docs for more information
* <a
href="https://struts.apache.org/core-developers/restful-action-mapper.html">RestfulActionMapper</a>
+ *
+ * @deprecated since 7.4.0, this legacy mapper predates the Struts REST
plugin, which is the maintained
+ * way to build REST-style applications with Struts. Scheduled for removal in
the next major release.
*/
+@Deprecated(forRemoval = true)
public class RestfulActionMapper implements ActionMapper {
protected static final Logger LOG =
LogManager.getLogger(RestfulActionMapper.class);
diff --git a/core/src/main/resources/struts-beans.xml
b/core/src/main/resources/struts-beans.xml
index 8ad4dff8b..e53710c22 100644
--- a/core/src/main/resources/struts-beans.xml
+++ b/core/src/main/resources/struts-beans.xml
@@ -79,6 +79,8 @@
class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper"/>
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="prefix"
class="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
+ <!-- Deprecated for removal: the legacy "restful" and "restful2" mappers
predate the Struts REST
+ plugin, which is the maintained way to build REST-style applications.
-->
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="restful"
class="org.apache.struts2.dispatcher.mapper.RestfulActionMapper"/>
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper"
name="restful2"