Results 1 to 3 of 3

Thread: Defining constant for Controllers

  1. #1
    Join Date
    Aug 2004
    Location
    Paris
    Posts
    43

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    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?

  3. #3
    Join Date
    Aug 2004
    Location
    Paris
    Posts
    43

    Default

    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 ?

Similar Threads

  1. Replies: 6
    Last Post: May 19th, 2006, 04:00 AM
  2. Problem defining cron expression
    By juan110470 in forum Container
    Replies: 1
    Last Post: May 26th, 2005, 08:55 PM
  3. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  4. Debug exceptions using ContextSingletonBeanFactoryLocator
    By timothygordon32 in forum Container
    Replies: 2
    Last Post: Feb 21st, 2005, 11:19 AM
  5. defining custom authorities...
    By briankuhn in forum Security
    Replies: 3
    Last Post: Dec 21st, 2004, 01:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •