Hi,

you might use context-parms:

<!--
The context-param element contains the declaration of a web
application's servlet context initialization parameters.
-->

<!ELEMENT context-param (param-name, param-value, description?)>

They will be available to all servlets in your web-app. So from
the Action-class you get your servlet and ask it for the ServletContext
and from there you should be able to get at the context-params.
Another way would be to set them in the action-servlet definition.

hope this helps
Alexander

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 4:31 PM
To: [EMAIL PROTECTED]
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

Reply via email to