Frank,

You can use the following in your Action class:

    String paramValue = this.servlet.getInitParameter("myParamName");

Thanks,
Venkat


-----Original Message-----
From: Frank Burns [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 19, 2004 8:19 PM
To: Struts Users Mailing List
Subject: How to read a parameter in web.xml from Action class


Hi,

>From an Action class, I want to read a parameter specified in the web.xml
file. I thought I could place it in an <init-param> block, within the
<servlet-name>action</servlet-name> element, like this:

    <init-param>
      <param-name>myParamName</param-name>
      <param-value>myParamValue</param-value>
    </init-param>

and then read it within the Action class using:

    String paramValue =
request.getSession().getServletContext().getInitParameter("myParamValue");

But I get null.

What am I doing wrong?

Thanks,

Frank.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




************************************************************************

If you have received this e-mail in error, please delete it and notify the sender as 
soon as possible. The contents of this e-mail may be confidential and the unauthorized 
use, copying, or dissemination of it and any attachments to it, is prohibited. 

Internet communications are not secure and Hyperion does not, therefore, accept legal 
responsibility for the contents of this message nor for any damage caused by viruses.  
The views expressed here do not necessarily represent those of Hyperion.

For more information about Hyperion, please visit our Web site at www.hyperion.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to