BeanValidator.addPropertyRule with map property
Hi all,
I'm developing a web application using Spring MVC, Spring's form tag library and the BeanValidator framework from Spring Modules.
Tha application employs a model with an HashMap property, here is a part of my model class:Code:
public class ImmobiliSezioneForm {
private Integer idImmobile;
private String nomeSezione;
private HashMaplt;String,Stringgt; campi;
private HashMaplt;String,Integergt; idCampi;
...
}
I put into the property quot;campiquot; an item with a key quot;Dimensionequot;, the tag library can read the value and render it on a jsp page, the model is correctly populated after a post of my form, but I'm not able to dynamically add a validation rule, this is the code I use to add the rule:Code:
beanValidator.addPropertyRule(quot;campi[Dimensione]quot;, new NotBlankValidationRule());
It seems the validator does not recognize the property name quot;campi[Dimensione]quot; ....
Can anyone please help me ?
Thanks in advance!! |