struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STR-2802) Validator validwhen :Cannot make dependance between two different index in an Array
Date Thu, 15 Mar 2007 22:03:57 GMT

    [ https://issues.apache.org/struts/browse/STR-2802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40571
] 

Henri Yandell commented on STR-2802:
------------------------------------


I suspect that the third of the array rules shouldn't have the LBRACKET on the end of it.
The problem with both Niall's test and the original report is that neither of them match one
of the 5 array rules. 

ie:

Index: ValidWhenParser.g
===================================================================
--- ValidWhenParser.g   (revision 518754)
+++ ValidWhenParser.g   (working copy)
@@ -182,7 +182,7 @@
             Object i3 = argStack.pop();
             argStack.push(ValidatorUtils.getValueAsString(form, i3 + "[" + i4 + "]" + i5));
 }
-| identifier LBRACKET integer RBRACKET LBRACKET {
+| identifier LBRACKET integer RBRACKET {
             Object i7 = argStack.pop();
             Object i6 = argStack.pop();
             argStack.push(ValidatorUtils.getValueAsString(form, i6 + "[" + i7 + "]"));

> Validator validwhen :Cannot make dependance between two different index in an Array
> -----------------------------------------------------------------------------------
>
>                 Key: STR-2802
>                 URL: https://issues.apache.org/struts/browse/STR-2802
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.8
>         Environment: Operating System: Windows 2000
> Platform: PC
>            Reporter: Oudot Christophe
>         Assigned To: Struts Developers
>
> This code in the validator.xml fails with this error : "unexpected token adr.."
>   
> <field property="adr[0]" depends ="validwhen"> 
>   <var> 
>       <var-name>test</var-name> 
>       <var-value>((*this*!=null) or (adr[1] != null ))</var-value> 
>   </var> 
> </field> 
> adr is an array of two adress lines. Only one of them needs tobe filled.
> According to the document of the validator, it should work.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message