Hi, I am using several times the same bean class for few controllers and I would like to know if there is a best practice with spring to define this commandClass once in the xml definition, and then to referer to it in my controllers.
Thks
Olivier
Printable View
Hi, I am using several times the same bean class for few controllers and I would like to know if there is a best practice with spring to define this commandClass once in the xml definition, and then to referer to it in my controllers.
Thks
Olivier
Not sure if I understand, but can't you just use:
to declare your class and:Code:<bean id="reusableClass" class="org.company.ReUseable">
to refer to it?Code:<ref local="reusableClass"/>
That will I think look like what you suggested, but in you case, you reference to an imlementation of the bean Reusable, and the CommandClass property in a controller will be a reference to the class of the bean you need to pass to the controller. this class will only be instanciated in the formBackingObject method. Any guess on how to refer to a class in the context ?