PDA

View Full Version : How to bind Map?


yanv
Mar 28th, 2007, 11:40 AM
Hi guys!
In my page i have a table in which each row has input pairs(<form:input each), for example: user, password.
On client I should support addition and removal of these pairs, i.e. the table has dynamic rows amount and of course user and password of each row might be modified.
My command object has a Map<User,Password> which i want to bind to aforementioned table. How do I do it?

Thanks in advance.

Yan.

leonardoborges
Mar 28th, 2007, 12:30 PM
I think that if you use the normal EL syntax in your form input would work:

${yourCommand.mapProperty[key]}

Did u try that?

yanv
Mar 28th, 2007, 12:40 PM
But how to manage new added rows? to which key to map them?
is it added automatically to command object?

I think that if you use the normal EL syntax in your form input would work:

${yourCommand.mapProperty}[key]

Did u try that?