Announcement Announcement Module
Collapse
No announcement yet.
Defining constant for Controllers Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Defining constant for Controllers

    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

  • #2
    Not sure if I understand, but can't you just use:
    Code:
    <bean id="reusableClass" class="org.company.ReUseable">
    to declare your class and:
    Code:
    <ref local="reusableClass"/>
    to refer to it?

    Comment


    • #3
      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 ?

      Comment

      Working...
      X