|
From: Colin S. <col...@ex...> - 2004-04-14 11:54:02
|
The existing spring approach is also similar to OGNL. In OGNL, '(' is
used for an actual method call, since you can also call methods, not
just navigate graphs.
I'm a bit of mixed feelings about adding '(' support in the BeanWrapper.
It would make the validation usage a bit more similar to
commons-validator/struts, but would muddy the water for general
expression syntax.
Karl, your issue with the setup right now is that people can't take
their existing definitions exactly as-is?
jürgen höller [werk3AT] wrote:
>Karl,
>
>Agreed, it makes sense to be consistent with Commons BeanUtils / Commons Validator / Struts here, while still supporting the current syntax. Our current syntax is somewhat analogous to JSTL EL, but I don't mind supporting further syntactic options, as long as they don't introduce parsing problems.
>
>This should be pretty trivial to add, so I'll look into it this weekend.
>
>Juergen
>
>
>________________________________
>
>Von: spr...@li... im Auftrag von Baum, Karl
>Gesendet: Mi 14.04.2004 04:19
>An: spr...@li...
>Betreff: [Springframework-developer] java.util.Map fields and commons validator
>
>
>
>I have encountered an issue in regards to validating beans backed by a
>Map object while using the spring commons validator component. My form
>is made to work with key value pairsbacked as a map. It has a field:
>
> /**
> * @return
> */
> public Map getValue() {
> return valueMap;
> }
>
> /**
> * @param map
> */
> public void setValue(Map map) {
> valueMap = map;
> }
>
>The problem isn't specific to the validator adapter. The problem has to
>do with the way Spring symbolizes a mapped property in the
>BeanwrapperImpl class. Spring uses a '[' where as commons validator and
>struts use '('. Another words a mapped property of firstName would look
>like this in Spring:
>
> value[firstName]
>
>and this in commons validator:
>
> value(firstName)
>
>Commons validator uses '[' for indexed properties. Spring uses '[' for
>both indexed and Mapped properties. I think the best place to fix this
>problem is on the Spring side in the BeanWrapperImpl. We might as well
>be consistent with struts and commons validator in regards to our
>indexed and mapped property sytax. Perhaps we can support both
>syntaxes.
>
>Any thoughts?
>
>Karl
>
>
|