I'm not real familiar with struts (yet), but I see no reason why you
couldn't put some standalone static code in your action class to read the
parameter.  The static code will get executed once when the action class is
instantiated and should do what you're looking for.

In other non-struts applications I've used a servlet that is set to be
loaded upon startup that reads all my start-up parameters and then stores
the values in the servlet application context so every class that has access
to the application context can read them.

Hope this helps,
Rob

-----Original Message-----
From: Alex Colic [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 10:31 AM
To: Struts
Subject: How to pass initialise parameters to action class


Hi,

I have an action class that has a variable that I want set from the web.xml
file. To prevent the action class from reading the xml file everytime it is
accessed I wanted to set the variable once in the action classes init()
method. After looking at the action class I see that there is no init()
method.

Any idea how I can set the value of a variable only once in the action
class?

Regards

Alex


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. 
It is intended for the addressee(s) only. Access to this E-mail by anyone else is 
unauthorized. If you are not an addressee, any disclosure or copying of the contents 
of this E-mail or any action taken (or not taken) in reliance on it is unauthorized 
and may be unlawful. If you are not an addressee, please inform the sender immediately.

Reply via email to