Announcement Announcement Module
Collapse
No announcement yet.
setting bean properties at run time Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • setting bean properties at run time

    I have some interface IMyInterface and a set of implementations of this interface. Every implementation has its own specific properties. At run time a user chooses the proper implementation and specifies property values for this implementation. So I need to get the right bean, set the property values and then I can use the bean via its interface.
    To get the proper implementation I use:
    Code:
    beanFactory.getBean(“implementation_key”);
    Problem is how to set (get) property values to the selected implementation bean (interface does not provide correspond getters and setters, because properties are specific for an implementation). Does Spring provide opportunity to set (get) the property values for my bean at run time?

    Pavel.

  • #2
    BeanWrapperImpl might be the right tool. It depends on what form you have collected the property values. Or maybe you can use DataBinder?

    Comment

    Working...
    X