Can the servletcontext declared as static:
private static ServletContext servletContext;
Not sure about it? Makes sense to me.
GreetZ
Nils
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 10, 2005 4:46 PM
To: Struts Users Mailing List
Subject: Re: Global scope
Take a look at this:
public class ApplicationContextListener implements ServletContextListener
{
private ServletContext servletContext = null;
public void contextInitialized(ServletContextEvent arg0) {
servletContext = arg0.getServletContext();
ApplicationBean applicationBean = new ApplicationBean();
servletContext.setAttribute("applicationBean",
applicationBean);
}
public void contextDestroyed(ServletContextEvent arg0) {
servletContext = arg0.getServletContext();
servletContext.removeAttribute("applicationBean");
}
}
HTH,
Glenn
"Nils Liebelt" <[EMAIL PROTECTED]>
10/05/2005 10:41 AM
Please respond to
"Struts Users Mailing List" <[email protected]>
To
"'Struts Users Mailing List'" <[email protected]>
cc
<[EMAIL PROTECTED]>
Subject
Global scope
Classification
Hi everybody,
Is there a global scope where you could dump e.g. a list of all users or
stuff that is needed in global context. Or just adding to each single
session?
GreetZ
Nils
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]