[
https://issues.apache.org/jira/browse/WW-5406?focusedWorklogId=913812&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-913812
]
ASF GitHub Bot logged work on WW-5406:
--------------------------------------
Author: ASF GitHub Bot
Created on: 10/Apr/24 04:53
Start Date: 10/Apr/24 04:53
Worklog Time Spent: 10m
Work Description: lukaszlenart commented on code in PR #910:
URL: https://github.com/apache/struts/pull/910#discussion_r1558837094
##########
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:
It's getting crowd'y here, what about moving all the injectable options into
`DispatcherOptions`? It doesn't have to happen now, but I can create a ticket
to address that later
##########
core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java:
##########
@@ -43,6 +43,8 @@ public class StrutsPrepareFilter implements StrutsStatics,
Filter {
protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING =
StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING";
protected PrepareOperations prepare;
+
+ @Deprecated
Review Comment:
Please document why it's deprecated and what to use instead. Also `since`
should be added, and feel free to create a ticket in JIRA to remove this
deprecated element in Struts 7. [An example
deprecation](https://github.com/apache/struts/blob/master/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java#L176)
Issue Time Tracking
-------------------
Worklog Id: (was: 913812)
Time Spent: 50m (was: 40m)
> 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: 50m
> 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)