This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 9ec214e84b Drop Tapestry specific code
9ec214e84b is described below

commit 9ec214e84bb7160d3d210e4669019fe4d465bc94
Author: remm <[email protected]>
AuthorDate: Fri May 22 09:54:06 2026 +0200

    Drop Tapestry specific code
---
 java/org/apache/catalina/manager/JspHelper.java    |  2 --
 .../apache/catalina/manager/util/SessionUtils.java | 37 +---------------------
 webapps/docs/changelog.xml                         |  5 +++
 3 files changed, 6 insertions(+), 38 deletions(-)

diff --git a/java/org/apache/catalina/manager/JspHelper.java 
b/java/org/apache/catalina/manager/JspHelper.java
index 5321670b63..067f8a0ef0 100644
--- a/java/org/apache/catalina/manager/JspHelper.java
+++ b/java/org/apache/catalina/manager/JspHelper.java
@@ -44,8 +44,6 @@ public class JspHelper {
 
     /**
      * Try to get user locale from the session, if possible.
-     * <p>
-     * IMPLEMENTATION NOTE: this method has explicit support for Tapestry 3 
and Struts 1.x
      *
      * @param in_session Session from which the locale should be guessed
      *
diff --git a/java/org/apache/catalina/manager/util/SessionUtils.java 
b/java/org/apache/catalina/manager/util/SessionUtils.java
index 17c1328196..8f22c50eb6 100644
--- a/java/org/apache/catalina/manager/util/SessionUtils.java
+++ b/java/org/apache/catalina/manager/util/SessionUtils.java
@@ -16,7 +16,6 @@
  */
 package org.apache.catalina.manager.util;
 
-import java.lang.reflect.Method;
 import java.security.Principal;
 import java.util.ArrayList;
 import java.util.Enumeration;
@@ -28,7 +27,6 @@ import javax.security.auth.Subject;
 import jakarta.servlet.http.HttpSession;
 
 import org.apache.catalina.Session;
-import org.apache.tomcat.util.ExceptionUtils;
 
 /**
  * Utility methods on HttpSessions.
@@ -62,8 +60,7 @@ public class SessionUtils {
 
     /**
      * Try to get user locale from the session, if possible. IMPLEMENTATION 
NOTE: this method has explicit support for
-     * Tapestry 3, Struts 1.x and Spring JSF check the browser meta tag 
"accept languages" to choose what language to
-     * display.
+     * Spring JSF check the browser meta tag "accept languages" to choose what 
language to display.
      *
      * @param in_session The session
      *
@@ -109,38 +106,6 @@ public class SessionUtils {
                 return locale;
             }
 
-            // Tapestry 3.0: Engine stored in session under 
"org.apache.tapestry.engine:" + config.getServletName()
-            // TODO: Tapestry 4+
-            final List<Object> tapestryArray = new ArrayList<>();
-            for (Enumeration<String> enumeration = 
in_session.getAttributeNames(); enumeration.hasMoreElements();) {
-                String name = enumeration.nextElement();
-                if (name.contains("tapestry") && name.contains("engine") && 
null != in_session.getAttribute(name)) {//$NON-NLS-1$ //$NON-NLS-2$
-                    tapestryArray.add(in_session.getAttribute(name));
-                }
-            }
-            if (tapestryArray.size() == 1) {
-                // found a potential Engine! Let's call getLocale() on it.
-                Object probableEngine = tapestryArray.getFirst();
-                if (null != probableEngine) {
-                    try {
-                        Method readMethod = 
probableEngine.getClass().getMethod("getLocale", (Class<?>[]) 
null);//$NON-NLS-1$
-                        // Call the property getter and return the value
-                        Object possibleLocale = 
readMethod.invoke(probableEngine, (Object[]) null);
-                        if (possibleLocale instanceof Locale) {
-                            locale = (Locale) possibleLocale;
-                        }
-                    } catch (Exception e) {
-                        Throwable t = 
ExceptionUtils.unwrapInvocationTargetException(e);
-                        ExceptionUtils.handleThrowable(t);
-                        // stay silent
-                    }
-                }
-            }
-
-            if (null != locale) {
-                return locale;
-            }
-
             // Last guess: iterate over all attributes, to find a Locale
             // If there is only one, consider it to be /the/ locale
             final List<Object> localeArray = new ArrayList<>();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0e922985de..02cf3e54ef 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -431,6 +431,11 @@
   </subsection>
   <subsection name="Web applications">
     <changelog>
+      <update>
+        Drop session handling dedicated to extracting the locale from Tapestry
+        attributes, used for locale session sorting in the manager webapp.
+        (remm)
+      </update>
       <!-- Entries for backport and removal before 12.0.0-M1 below this line 
-->
       <add>
         Manager: Add checks to ensure that any uploaded files are uploaded to


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to