struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4109) ParameterNameAware Javadoc incorrect
Date Mon, 21 Oct 2013 12:20:45 GMT

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

ASF subversion and git services commented on WW-4109:
-----------------------------------------------------

Commit 1534123 from [~lukaszlenart] in branch 'struts2/trunk'
[ https://svn.apache.org/r1534123 ]

WW-4109 WW-4154 Reverts to previous behaviour where both ParametersInterceptor and ParameterNameAware
must accept parameter

> ParameterNameAware Javadoc incorrect
> ------------------------------------
>
>                 Key: WW-4109
>                 URL: https://issues.apache.org/jira/browse/WW-4109
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: 2.3.14.3, 2.3.15
>            Reporter: Andreas Sachs
>            Priority: Minor
>             Fix For: 2.3.16
>
>
> I think the Javadoc of ParameterNameAware is wrong:
> {noformat}
> * This interface is implemented by actions that want to declare acceptable parameters.
Works in conjunction with {@link 
> * ParametersInterceptor}. For example, actions may want to create a whitelist of parameters
they will accept or a 
> * blacklist of paramters they will reject to prevent clients from setting other unexpected
(and possibly dangerous) 
> * parameters.
> {noformat}
> It's not possible to blacklist parameters because of the "or" in:
> {code:java}
> boolean acceptableName = acceptableName(name)
>                     || (parameterNameAware != null && parameterNameAware.acceptableParameterName(name));
> {code}
> Since there was some discussion about this some time ago, i would prefer to make ParameterNameAware
deprecate and add a new interface with 3 return values:
> -> accept parameter
> -> reject parameter
> -> no decission, use acceptableName
> Another possibility would be to add the result of acceptableName to acceptableParameterName.
> e.g. parameterNameAware.acceptableParameterName(name, acceptableName(name)));
> The ParameterNameAware-Action can decide, if the result of acceptableName should be overwritten
or not.
> Thanks
> Andi



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message