Depends on what technology stack you have in place.

For our platforms we have two approaches.  The first is to make use of
an application properties file.  It is XML base in which it has several
roots, each root indicates an environment.  The servers JVM makes use of
the -D option such as -Denv=local.  We created a simple reusable library
that reads from the properties file.

The other way is with Spring.  Can do the same thing as above except in
our case we create several properties files with a prefix of the env.
Then Spring is set up to read in again the JVM -D option and then calls
upon that file to set/use the properties.



-----Original Message-----
From: Jim May [mailto:jim.webg...@gmail.com] 
Sent: Monday, October 24, 2011 4:47 PM
To: MyFaces Discussion
Subject: Best practice for storing application variables

I know this question is not directly associated with MyFaces, but more a
general web application question.

What is the best practice for storing application variables that need to
be
changed once deployed to an environment? I want to use these variables
in my
application scoped bean in the JSF web project.

I was wondering what others have done. Right now, I am doing a jndi
lookup
for Strings and setting them on my application scoped bean. I feel like
there is a better way of doing it.

Thank You,
-- 
James May
Software Engineer / Architect
http://www.jamesmay.me

Reply via email to