You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Niall Pemberton <ni...@gmail.com> on 2007/05/08 18:24:14 UTC
Re: [S1] validate attribute possible bug used together with extends attribute
I believe this was fixed in Struts 1.3.8
https://issues.apache.org/struts/browse/STR-2955
http://svn.apache.org/viewvc?view=rev&revision=480593
Niall
On 5/8/07, disalle@di.univaq.it <di...@di.univaq.it> wrote:
> Hi all,
> We have found a possible bug in struts 1.3.5 (may be also in 1.3.8) during
> the use of the validate attribute together with extends attribute. The
> struts-config.xml is the following: <action
> path="/anagrafiche/ins_circo_start"
> type="circhi.anagrafiche.presentation.circhi.CircoAction"
> validate="false" parameter="activecreate,default=activecreate">
> <forward name="active" path="anagrafiche.circo"/>
> </action>
>
> <action path="/anagrafiche/ins_circo_end"
> extends="/anagrafiche/ins_circo_start"
> name="circoForm" scope="request"
> cancellable="true" validate="true" input="anagrafiche.circo"
> parameter="create_end=create">
> <exception type="business.BusinessException" key="error.businessexception"
> path="anagrafiche.circo"/> <forward name="success" path="common.ok"/>
> </action>
>
> The problem is that the validate attribute is not overrided in the second
> action (i.e. /anagrafiche/ins_circo_end). So the validation process is not
> performed when the /anagrafiche/ins_circo_end is called. The possible bug
> is in the inheritFrom method of the ActionConfig class.
> In particular in the following statement:
> if (getValidate()) {
> setValidate(config.getValidate());
> }
> the getValidate() returns the value of the validate attribute and not if
> it is as been overridden or not.
>
> IS IT CORRECT?
>
> A possible solution can be to add an instance variabile "boolean
> validateattributesetted=false" that is set to true when the setValidate
> method is called and change the statement if
> (getvalidateAttributeSetted()). The same problem may occur in the
> cancellable attribute.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: [S1] validate attribute possible bug used together with
extends attribute
Posted by di...@di.univaq.it.
Niall thanks a lot!!!
I upgrade the struts version.
Sorry if in the previous email I didn't sign.
BR
/Amleto
> I believe this was fixed in Struts 1.3.8
>
> https://issues.apache.org/struts/browse/STR-2955
> http://svn.apache.org/viewvc?view=rev&revision=480593
>
> Niall
>
> On 5/8/07, disalle@di.univaq.it <di...@di.univaq.it> wrote:
>> Hi all,
>> We have found a possible bug in struts 1.3.5 (may be also in 1.3.8)
> during
>> the use of the validate attribute together with extends attribute. The
>> struts-config.xml is the following: <action
>> path="/anagrafiche/ins_circo_start"
>> type="circhi.anagrafiche.presentation.circhi.CircoAction"
>> validate="false" parameter="activecreate,default=activecreate">
>> <forward name="active" path="anagrafiche.circo"/>
>> </action>
>>
>> <action path="/anagrafiche/ins_circo_end"
>> extends="/anagrafiche/ins_circo_start"
>> name="circoForm" scope="request"
>> cancellable="true" validate="true" input="anagrafiche.circo"
>> parameter="create_end=create">
>> <exception type="business.BusinessException"
> key="error.businessexception"
>> path="anagrafiche.circo"/> <forward name="success" path="common.ok"/>
>> </action>
>>
>> The problem is that the validate attribute is not overrided in the
> second
>> action (i.e. /anagrafiche/ins_circo_end). So the validation process is
> not
>> performed when the /anagrafiche/ins_circo_end is called. The possible
> bug
>> is in the inheritFrom method of the ActionConfig class.
>> In particular in the following statement:
>> if (getValidate()) {
>> setValidate(config.getValidate());
>> }
>> the getValidate() returns the value of the validate attribute and not if
>> it is as been overridden or not.
>>
>> IS IT CORRECT?
>>
>> A possible solution can be to add an instance variabile "boolean
>> validateattributesetted=false" that is set to true when the setValidate
>> method is called and change the statement if
>> (getvalidateAttributeSetted()). The same problem may occur in the
>> cancellable attribute.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.6.2/787 - Release Date: 03/05/2007
> 14.11
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org