Validatino of Indexed Properties Incorrectly Flags Required Fields When No Indexed Properties Submitted

Description

I know the summary isn't very clear, so here is what I see happening: According to the Stripes online documentation:

"Required field validations are only applied if at least one value with the same index was supplied."

In my case, I am not submitting ANY values with any indexes, however, Stripes is reporting validation messages for the fields that are marked as required.

To put it another way: Say for example I have a List of Person objects on the ActionBean named persons. On the ActionBean, the "List<Person> persons" is annotated so that the firstName property of the Person objects within the List is required.

If the form submits something like this:

persons[0].firstName=
persons[0].lastName=

Then Stripes will NOT show a "required" error message for firstName, because all of the values with the same index are empty.

However, if the form submits WITHOUT any indexed properties for persons, it is showing a required error message for firstName, which I'm guessing is not the intended behavior... at least I hope not!

Also, related to the above, if a required indexed property is marked as encrypted and no values are sent, a NullPointerException on line 494 of DefaultActionBeanPropertyBinder is is thrown. I'm pretty sure that's not the intended behavior!

See the attached zip file. It's a project that you can build and deploy to Tomcat that shows the errors and issues I'm seeing. It's a NetBeans project so if you use NetBeans you can open the project right in NetBeans. Otherwise, open it in your favorite IDE and run the "dist" task from build.xml to build a war file you can deploy.

Once you deploy, go to the /sip/MyTest.action page, and run the examples from there.

As I say in index.jsp, I think the problem stems from the fact that Stripes doesn't "know" that certain properties are indexed properties unless the indexed property names are submitted with the form. But shouldn't Stripes know what's indexed by looking at the validation annotations and determining which properties contain Lists?

Environment

Windows, Tomcat 6, Java 6

Status

Assignee

Unassigned

Reporter

"Failed to Retrieve User "

Labels

Tester

None

Components

Affects versions

Release 1.5.7

Priority

Major
Configure