aspose file tools*
The moose likes Struts and the fly likes Request VS Application Context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Request VS Application Context" Watch "Request VS Application Context" New topic
Author

Request VS Application Context

Songezo Nkukwana
Ranch Hand

Joined: Nov 27, 2008
Posts: 51
What are the dangers of putting data (Collection) on the application Scope
? Thing is i need to share my collection between JSPs/Actions ...
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You might want to ask this in the servlets form as it's not really a Struts question.

If the data is application-wide and not user-specific--that's what the application context is *for*. The only real danger is using up memory, IMO. And possibly the need to make sure the app-scoped data is in sync with the backing DB values, but there are many ways around that.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
What happens when there is a cluster of 250 web servers hosting a "web application?" Which one of the servers will have the "shared data" Collection object? Will all of the servers have a copy of the data (object)?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I imagine it depends on how it's set up, but I'd be surprised if each machine didn't have its own application context, otherwise there would have to be a mechanism for getting the app scope from a given machine/set of machine, which defeats (one, anyway) the purpose of clustering.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request VS Application Context