[ 
https://issues.apache.org/jira/browse/WW-3720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18128166#comment-18128166
 ] 

Lukasz Lenart commented on WW-3720:
-----------------------------------

Closing this without adding a dedicated list syntax. The readability goal is 
already covered: a comma-delimited value can be split across lines inside a 
single {{param}}, because both the XML reader and the comma-list parser trim 
surrounding whitespace.

{code:xml}<param name="excludeMethods">
    input,
    back,
    cancel
</param>
{code}

This works on the interceptor definition and as an override on an 
{{interceptor-ref}}. [PR #2040|https://github.com/apache/struts/pull/2040] adds 
a test that pins this behaviour so it stays supported.

A real list element would need the configuration model to carry non-String 
parameter values. Parameters are plain strings throughout: XML, annotations, 
interceptor/action/result configs and lazy parameters. Many interceptors across 
core and the plugins share the same comma-separated convention, so the change 
would be large for little gain over the form above.

> Support collection-based properties in .xml
> -------------------------------------------
>
>                 Key: WW-3720
>                 URL: https://issues.apache.org/jira/browse/WW-3720
>             Project: Struts 2
>          Issue Type: New Feature
>            Reporter: Ilya
>            Priority: Minor
>             Fix For: 7.5.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> MethodFilterInterceptor.setExcludeMethods accepts coma-separated list of 
> methods and it should be typed in such way in XML too.
> It would be much better to support collections:
> <param name="workflow.excludeMethods">
>   <list>
>    <element>input</element>
>    <element>back</element>
>    <element>cancel</element>
>   </list>
> </param>
> and 
> MethodFilterInterceptor.setExcludeMethods(String... methods)
> or
> MethodFilterInterceptor.setExcludeMethods(Collection<String> methods)



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

Reply via email to