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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]