struts-user mailing list archives

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

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:

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/index.html

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 =
        this.getServlet().getServletContext().getAttribute("USER_MAP");

Or something like that.

-jason

> 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:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message