|
Is there any workaround for this bug? I have a similar requirement (need to check for presence of EITHER one field or at least one item in an array field (items selected from an HTML list), but have run into the same issue.
Is there any other way to configure the validator to do this kind of check, at least until this bug gets fixed? It's now March 2007; I was wondering if any progress had been made on this bug. I am working on struts 1.3.5, and I encounter the same issue with the following code:
<var-value>((*this* != null) or ((govIDParts[0] == null) and (govIDParts[2] == null)))</var-value> I doubt anyones looking at this - It needs someone to come forward with a patch to fix it
Do you still have your test case Niall?
I didn't (I changed machines since then) - but I've re-created one and committed it:
http://svn.apache.org/viewvc?view=rev&revision=515237 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 + "]")); svn ci -m "Fixing
d what the LBRACKET would have been there for so I think it was just an error that's been in there forever and ever. " src/ Sending src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g Sending src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java Transmitting file data .. Committed revision 520763. The fix for
http://svn.apache.org/viewvc?view=rev&revision=569606 |
||||||||||||||||||||||||||||||||||||||||||||||||
http://www.mail-archive.com/user%40struts.apache.org/msg43177.html
I had a quick look at the source (ValidWhenParser.g) and I agree it looks like
it should cater for this. I also tried adding a test case (to
TestValidWhen.java) to and got the same result as Christophe.