Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Where is the best place to put an appication variable???

Thread view: 
simon_s_li@hotmail.com - 26 Oct 2005 11:49 GMT
Hi,

I need to store a value, which tells us what mode an application is in.

Basically it needs to be stored on an application level.

Can someone please advise me the best place to store this value, where
it can be accessed from any where within the system.

Thanks
Simon
Roedy Green - 26 Oct 2005 13:00 GMT
>Can someone please advise me the best place to store this value, where
>it can be accessed from any where within the system.

The easiest place is in a flat file. If you want to get fancy, in
Windows you can put it in the registry.

Probably the safest place is in a database.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

simon_s_li@hotmail.com - 26 Oct 2005 15:42 GMT
I already read the value from a xml file, but I need to store it
somewhere in the application at an application level.

The reason we need this is we aim to have 2 versions of the
application, but on 2 separate servers.  What needs to happen is that
when the application deploys or loads, it reads an xml file and that
will decide what menus will be displayed based on the value.

This means it cannot be stored on the database because they both point
to the same database.

It cannot be in registry or flat file.

Any other ideas?

Regards
Simon
Malte - 26 Oct 2005 19:33 GMT
> I already read the value from a xml file, but I need to store it
> somewhere in the application at an application level.
[quoted text clipped - 13 lines]
> Regards
> Simon

If webapp, store it in web.xml
Knute Johnson - 26 Oct 2005 19:35 GMT
> I already read the value from a xml file, but I need to store it
> somewhere in the application at an application level.
[quoted text clipped - 13 lines]
> Regards
> Simon

Well I think I would store it as an instance or class variable in the
class where I read the XML file.  No sense getting too complicated.

Signature

Knute Johnson
email s/nospam/knute/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.