bernardsirius
04-03-2005, 12:16 AM
Hi,
I'm using the spring framework (http://www.springframework.org/) at the backend, and I'm trying to take advantage of their nested binding mechanism.
Spring makes it possible to automatically bind request parameters to object (bean-) properties. This is done using the well-known javaBeans pattern, where object.property stands for "the property named 'property' of the 'object' bean".
For collection properties, Spring uses Maps: you can attach a Hashtable to your bean; let's say you have a Person Bean and Address objects attached to it... in Spring you would have a Hashtable 'addresses' property, with keys like 'Home', 'Work', etc...
Then to bind a particular address with request parameters, you would name your parameters with square brackets:
addresses[Work], addresses[Home]...
Yes BUT laszlo apparently prevents the use of brackets: I consistently get form parameters ending with a question mark, like this:
addresses[Work?, addresses[Home?
...which completely breaks my plans to use this very handy mechanism of spring's...
Do you guys know how to have my square brackets straight?
bernard
I'm using the spring framework (http://www.springframework.org/) at the backend, and I'm trying to take advantage of their nested binding mechanism.
Spring makes it possible to automatically bind request parameters to object (bean-) properties. This is done using the well-known javaBeans pattern, where object.property stands for "the property named 'property' of the 'object' bean".
For collection properties, Spring uses Maps: you can attach a Hashtable to your bean; let's say you have a Person Bean and Address objects attached to it... in Spring you would have a Hashtable 'addresses' property, with keys like 'Home', 'Work', etc...
Then to bind a particular address with request parameters, you would name your parameters with square brackets:
addresses[Work], addresses[Home]...
Yes BUT laszlo apparently prevents the use of brackets: I consistently get form parameters ending with a question mark, like this:
addresses[Work?, addresses[Home?
...which completely breaks my plans to use this very handy mechanism of spring's...
Do you guys know how to have my square brackets straight?
bernard