You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sashi Ravipati <Ra...@michigan.gov> on 2003/06/25 16:09:50 UTC
How to read < init-parm> defined in web.xml in an Action class
Hi
I have this entry in my web.xml file
<init-param>
<param-name>developer-test-id</param-name>
<param-value>testmode</param-value>
</init-param>
How can I get the value (testmode) in my action class.
In a servlet we I could do it like this
public void init(ServletConfig config) throws ServletException
{
super.init(config);
String ssoId = config.getInitParameter("developer-test-id");
}
How can I achieve the same in Struts. This is required as once the development is done and we deploy the access will be thru SingleSign On. So I want to use this as a switch.
Thanks
RE: How to read < init-parm> defined in web.xml in an Action class
Posted by Varun Garg <va...@yahoo.com>.
Try this
this.servlet.getServletConfig().getInitParameter()
-----Original Message-----
From: Sashi Ravipati [mailto:RavipatiS@michigan.gov]
Sent: Wednesday, June 25, 2003 9:10 AM
To: struts-user@jakarta.apache.org
Subject: How to read < init-parm> defined in web.xml in an Action class
Hi
I have this entry in my web.xml file
<init-param>
<param-name>developer-test-id</param-name>
<param-value>testmode</param-value>
</init-param>
How can I get the value (testmode) in my action class.
In a servlet we I could do it like this
public void init(ServletConfig config) throws ServletException
{
super.init(config);
String ssoId = config.getInitParameter("developer-test-id");
}
How can I achieve the same in Struts. This is required as once the
development is done and we deploy the access will be thru SingleSign On.
So I want to use this as a switch.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org