From 58e052dd71b231145aedb976059fe3028153d7e5 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Sun, 30 Aug 2026 08:46:21 +0200 Subject: [PATCH] WW-5707 chore(core): deprecate legacy restful and restful2 action mappers 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 Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_016XMyQ1CRuYZkqygmD4aGHv --- .../struts2/dispatcher/mapper/Restful2ActionMapper.java | 4 ++++ .../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 988c23943c..d0332c301f 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 @@ /** * Extended version of {@link RestfulActionMapper}, see documentation for more details * Restful2ActionMapper + * + * @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 d93d45e98f..2a77350834 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 @@ -34,7 +34,11 @@ * Simple Restfull Action Mapper to support REST application * See docs for more information * RestfulActionMapper + * + * @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 8ad4dff8be..e53710c229 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"/> +