[EMAIL PROTECTED] wrote:
OK, Perhaps then a session is not what is required here. I wish to make available upon startup of the server, some simple string values. They must be accessible to all clients, auto initialised when the service starts up. This is something similar to a posting I made a while ago reagrding libraries. I want to load into memory these values when the server starts, that will be accessible to all clients.You need to implement a ContextListener class. Here's a snippet of what I have:
Thanks
Paul.
1) Java:
package com.terma.martin.drs.util;
import java.io.*;
import java.util.*;
import javax.servlet.*;
public class ApplicationInitializer implements ServletContextListener
{
public void contextInitialized(ServletContextEvent sce)
{
ServletContext ctx = sce.getServletContext();
String propsFileName = ctx.getInitParameter("props-file");
... etc.
2) web.xml:
<web-app>
<context-param>
<param-name>props-file</param-name>
<param-value>/WEB-INF/app.properties</param-value>
</context-param>
<listener>
<listener-class>com.terma.martin.drs.util.ApplicationInitializer</listener-class>
</listener>
HTH
Martin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
