Issue Details (XML | Word | Printable)

Key: STR-2802
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Oudot Christophe
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Struts 1

Validator validwhen cannot test between two different indices in array

Created: 18/Mar/06 12:54 AM   Updated: 05/Jun/08 06:18 AM
Return to search
Component/s: Core
Affects Version/s: 1.2.8
Fix Version/s: 1.3.10, 1.4.0

Environment:
Operating System: Windows 2000
Platform: PC

Bugzilla Id: 39020


 Description  « Hide
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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
Struts #515237 Tue Mar 06 18:17:51 UTC 2007 niallp Add a test case to demonstrate Jira Isssue STR-2802
Files Changed
MODIFY /struts/struts1/trunk/core/src/test/java/org/apache/struts/validator/TestValidWhen.java
MODIFY /struts/struts1/trunk/core/src/test/java/org/apache/struts/validator/PojoBean.java

Repository Revision Date User Message
Struts #520762 Wed Mar 21 05:53:44 UTC 2007 bayard Breaking the build by putting the unit test for STR-2802 fully in
Files Changed
MODIFY /struts/struts1/trunk/core/src/test/java/org/apache/struts/validator/TestValidWhen.java

Repository Revision Date User Message
Struts #520763 Wed Mar 21 05:57:10 UTC 2007 bayard Fixing STR-2802 by removing the unnecessary LBRACKET. Test now passes and I don't understand what the LBRACKET would have been there for so I think it was just an error that's been in there forever and ever.
Files Changed
MODIFY /struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java
MODIFY /struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g