Results 1 to 5 of 5

Thread: Config data for the whole application

  1. #1

    Default Config data for the whole application

    Hi All

    I'll need to share some configuration data to be shared by my Spring application. Which is the best way to keep this data in the way that it could be accesible from controllers, web flow actions, etc ?

    Thanks in advance

    C

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    It depends on what requirements you have - you can use a database but that usually is good when you have a big amount of info so you can take advantage of quering. If you have a small configuration then you can place it inside a registry/singleton of some sort - a tranditional JNDI or a simple bean defined as singleton which can be injected or lookup through the application context.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Oct 2005
    Location
    Belgium
    Posts
    87

    Default

    What do you want to do?

    1. inject that configuration data into multiple components?
    --> use placeholders
    2. read the configuration data that from those components at runtime?
    --> read previous post, it depends on the requirements

  4. #4

    Default

    Quote Originally Posted by rebornspirit
    What do you want to do?

    1. inject that configuration data into multiple components?
    --> use placeholders
    2. read the configuration data that from those components at runtime?
    --> read previous post, it depends on the requirements

    Thanks for both replys.

    IŽll like the first solution. What do you mean with placeholders ?


    C

  5. #5
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    See the javadoc or/and the reference documentation for a description of what the class does.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

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