[ 
https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913819&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913819
 ]

ASF GitHub Bot logged work on WW-5406:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Apr/24 05:50
            Start Date: 10/Apr/24 05:50
    Worklog Time Spent: 10m 
      Work Description: kusalk commented on code in PR #910:
URL: https://github.com/apache/struts/pull/910#discussion_r1558881309


##########
core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java:
##########
@@ -340,6 +348,27 @@ public void setMultipartValidationRegex(String 
multipartValidationRegex) {
         this.multipartValidationPattern = 
Pattern.compile(multipartValidationRegex);
     }
 
+    @Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN_SEPARATOR, 
required = false)
+    public void setActionExcludedPatternsSeparator(String separator) {
+        this.actionExcludedPatternsSeparator = separator;
+    }
+
+    @Inject(value = StrutsConstants.STRUTS_ACTION_EXCLUDE_PATTERN, required = 
false)
+    public void setActionExcludedPatterns(String excludedPatterns) {
+        this.actionExcludedPatterns = 
buildExcludedPatternsList(excludedPatterns, actionExcludedPatternsSeparator);
+    }
+
+    private static List<Pattern> buildExcludedPatternsList(String patterns, 
String separator) {
+        if (patterns == null || patterns.trim().isEmpty()) {
+            return emptyList();
+        }
+        return 
unmodifiableList(Arrays.stream(patterns.split(separator)).map(String::trim).map(Pattern::compile).collect(toList()));
+    }
+
+    public List<Pattern> getActionExcludedPatterns() {
+        return actionExcludedPatterns;
+    }

Review Comment:
   WW-5410





Issue Time Tracking
-------------------

    Worklog Id:     (was: 913819)
    Time Spent: 1h 10m  (was: 1h)

> Action excluded patterns are not updated following a configuration reload
> -------------------------------------------------------------------------
>
>                 Key: WW-5406
>                 URL: https://issues.apache.org/jira/browse/WW-5406
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>            Reporter: Kusal Kithul-Godage
>            Priority: Minor
>             Fix For: 6.5.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> If {{struts.action.excludePattern}} or 
> {{struts.action.excludePattern.separator}} are updated during runtime, the 
> changes are not reflected in the application behaviour due to these constants 
> only being read exactly once. This is not consistent with all other 
> configuration which is re-injected following a configuration reload.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to