Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AF68B10057 for ; Mon, 17 Jun 2013 04:52:22 +0000 (UTC) Received: (qmail 88919 invoked by uid 500); 17 Jun 2013 04:52:21 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 88787 invoked by uid 500); 17 Jun 2013 04:52:20 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 88612 invoked by uid 99); 17 Jun 2013 04:52:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jun 2013 04:52:20 +0000 Date: Mon, 17 Jun 2013 04:52:20 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4109) ParameterNameAware Javadoc incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13684973#comment-13684973 ] Lukasz Lenart commented on WW-4109: ----------------------------------- Just assigned it to 2.3.16 to keep focus on it and discuss > 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira