File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Bean in application scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Bean in application scope" Watch "Bean in application scope" New topic
Author

Bean in application scope

Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 256
I have a situation where all users need (only read, no write) to have access to the same information.
My solution is to add the needed info to a bean and stuff it into the application scope, this way I don't need to stuff the bean into each request or session. However I also need to refresh this information at regular intervals. I'm worried that I may step on the object just when a user is trying to access this object, ie, it is not synchronized.

Is my initial solution correct for the situation and if so how would I take care of the synchronization issues.

TIA
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not really a Struts issue.

Synchronization is a topic well-covered on the web and in other JavaRanch forums.
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 256
Thanks David. Thought as much when I submitted, but put it out here since I'm using struts and its a web app. With the application scope. So put it in the java in general section then ?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't know which forum would be best; I really only hang out here in Struts.
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 256
heh.. ok. Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bean in application scope
 
Similar Threads
Access a Servlet config from a non-Servlet
JavaBeans in Servlets
Concurrency with Application scope (Web App) objects
Spring portlet MVC forms, multipart data and servlets?
How do Javabeans work?