here are some code samples. in web.xml:
<servlet>
<servlet-name>_etrain_startup_</servlet-name>
<servlet-class>com.edavidlu.util.StartupServlet</servlet-class>
<init-param>
<param-name>email.enable</param-name>
<param-value>true</param-value>
<description>
Set to true to enable out-going email, false to disable.
</description>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
in StartUpServlet:
public class StartupServlet extends HttpServlet
{
/**
* Called by the application container to initialize the
application.
*/
public void init( ServletConfig config ) throws ServletException
{
super.init( config );
for ( Enumeration en = config.getInitParameterNames();
en.hasMoreElements(); )
{
String key = (String) en.nextElement();
String value = config.getInitParameter( key );
// save key/value where your beans can get to them.
}
}
On 2002.04.12 07:57 Danilo Luiz Rheinheimer wrote:
> At 10:37 12/4/2002 -0400, you wrote:
>> You can put these as init-param entries in web.xml. If I have a
>> large
>> number of them and/or the administrator may need to edit them, I put
>> them in
>> a properties file and create an init-param entry that points to this
>> file.
>> I trust someone editing the properties file more than the deployment
>> descriptor. :-)
>
> And how do you access it on the beans code ?
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>