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
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
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
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
Originally Posted by rebornspirit
Thanks for both replys.
IŽll like the first solution. What do you mean with placeholders ?
C
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