Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
ValidWhen Error Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ValidWhen Error


    I have the following ValidWhen validator set up for my form and it throws an error b/c
    ValidWhen cannot resolve the "test" variable. Does anyone see something wrong with this xml?

                <field property="miles" depends="integer,validwhen">
                    <arg0 key="miles"/>
                      <var-value>(miles!= null)</var-value>
    I looked at the relevant validateValidWhen method that throws this error and it looks ok to me (so I'm not sure the bug is spring-modules instead of my above config):
             String test = field.getVarValue("test");
            if (test == null) {
                String msg = "ValidWhen Error 'test' parameter is missing for field ' " + field.getKey() + "'";
                errors.rejectValue(field.getKey(), msg);
                return false;
    I am seeing a message in my logs that says:

    ValidWhen Error 'test' parameter is missing for field ' miles'";
    Any help is appreciated.