struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Viral_Thakkar" <Viral_Thak...@infosys.com>
Subject RE: application configuration
Date Thu, 08 Jul 2004 11:55:33 GMT
I have a java file which read few properties file and put the key and
values read from these properties into HashMap object of singleton
class..

I am doing this to read all Fixed Values which I need to display in my
jsp pages.

Now I want this class to run as soon as server starts... how to achieve
this ..??

One approach ...to create a servlet and configure it in web.xml with 
    <load-on-startup>1</load-on-startup>

Is this ok...or is there any better approach to do the same thing..?

Regards,
Viral



-----Original Message-----
From: Andrew Hill [mailto:andrew.david.hill@gridnode.com] 
Sent: Thursday, July 08, 2004 4:56 PM
To: Struts Users Mailing List
Subject: RE: application configuration

I tend to put such things in XML files rather than properties files
nowadays.

When the app starts up I have a plugin read the files and create
configuration objects (using Digester), and put these objects into the
servlet context (application scope) where my code can get at them
easily.


-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of j h
Sent: Thursday, 8 July 2004 19:23
To: user@struts.apache.org
Subject: application configuration


If there are specific properties that need to be configured on
deployment,
where should these be put? you could put these in the
application.properties
file and read these in from an Action class every time they are needed:
MessageResources mr = getResources(request);
String config = mr.getMessage("configuration.detail");

This seems inefficient. Is there a way to read these into some global
variables?




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message