Hi.
I suspect that I have stumbled across a limitation of valang...and perhaps a bug.
Background:
I am using an extended AbstractWizardFormBean. Instead of using a single large object as form bean, I use a Map and each individual view uses an object keyed against the view name (ie home' -> HomeFormbean).
This is all working well.
I have been trying to use valang. Server-side validation works great (by the way: good work, guys!). My trouble is with the client side stuff.
Specifically the valang:validate tag.
To see this, look at my (Spring MVC/JSP) form:
With rules:Code:... <form:form method="post" id="homeForm" commandName="command.map['home']> <valang:validate commandName="command.map['home']" /> <form:input path="address" /> </form> ...
When the form is invoked, this givesCode:<bean id="valangAddressCheckValidator" class="org.springmodules.validation.valang.ValangValidator"> <property name="valang"> <value> <![CDATA[ { address ? is not blank : '...' : '...' } ]]> </value> </property> </bean>
So I try:Code:IllegalArgumentException: No valang rules for command 'command.map['home']' were found in the page context.
With rules:Code:... <form:form method="post" id="homeForm" commandName="command.map['home']> <valang:validate commandName="command" /> </form> ...
Code:<bean id="valangAddressCheckValidator" class="org.springmodules.validation.valang.ValangValidator"> <property name="valang"> <value> <![CDATA[ { map['home'].address : ? is not blank : '...' : '...' } ]]> </value> </property> </bean>
The form is now invoked OK and displayed in the browser.
On submit, however, I get an exception:
I THEN try:Code:org.springframework.beans.NotReadablePropertyException: Invalid property 'map[home]' of bean class [...HomeFormBean]: Bean property 'map[home]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
With rules:Code:... <form:form method="post" id="homeForm" commandName="command.map['home']> <valang:validate commandName="command" /> <form:input path="address" /> </form> ...
and this gives:Code:<bean id="valangAddressCheckValidator" class="org.springmodules.validation.valang.ValangValidator"> <property name="valang"> <value> <![CDATA[ { address ? is not blank : '...' : '...' } ]]> </value> </property> </bean>
This last attempt seems to have thrown up a bug?Code:NotReadablePropertyException: Invalid property 'map[home].map[home]' of bean class [...ScriptFormController$ScriptFormBean]: Bean property 'map[home].map[home]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
Can anyone give guidance as to whether/how valang can be used in this situation?
Am I going to have this same issue with commons validation?
Attached are a few stack traces.
Thannks in advance for any help/comments!
Cheers,
Alph


