PDA

View Full Version : Dynamic fields on JSP / in java bean


pak
08-17-2004, 07:12 AM
Hi there

I am not sure exactly what sub-group this question best fits under...

Is there a "recommended" way of implementing dynamic fields?

It is very easy to map, via xml configuration, fields on a JSP to instance variables (getter/setter methods) in a Java bean. But what if I want "dynamic" fields on my JSP - that is, the user can add a new text field or something, which can be submitted in the form to my controller. How could this dynamic field be mapped to my java bean?

Thanks,
Peter

ojolly
11-12-2004, 11:59 AM
Since the bean can not be augmented on the fly with property (excepted with aop), I would suggest to use a Map for those fields (eventually nested if you want complex fields) or eventually to use the BeanWrapper facility to work with a bean in a similar way than a simple map.

HTH

Olivier

sarvananda
07-14-2007, 09:05 AM
Hi,
I am facing the same problem now. Did you get any workaround with this ?


thanks