struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason L. Buberel" <>
Subject Re: How to Access an Application Scope object in a Struts Action
Date Wed, 15 Jan 2003 05:49:08 GMT

Are you using a Servlet Container that is compatible with the Java Servlet 2.3 
API? If so, this sort of thing should be implemented as a Servlet Filter:

We use this in our product to verify authentication credentials and such. 
Works quite nicely. 

If that is not an option for you, you can use an Application Scoped map which 
you can access from within an Action class using:

this.getServlet().getServletContext().setAttribute("USER_MAP", userMap);

Map userMap =

Or something like that.


> I am working on a similar monitor class to track the users logged into a
> web application at any given time. This information is displayed when user
> logs into the web application. 
> i am trying to accomplish this using ServletContextListener and
> HttpSessionAttributeListener classes in the servlet API.
> Any help/ideas about tracking users currently logged into a web application
> are most welcome.
> Thanks,
> Rana.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message