aspose file tools*
The moose likes Struts and the fly likes Can two applications running on one server share an application-scoped variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Can two applications running on one server share an application-scoped variable?" Watch "Can two applications running on one server share an application-scoped variable?" New topic
Author

Can two applications running on one server share an application-scoped variable?

Eugene Abarquez
Ranch Hand

Joined: May 18, 2006
Posts: 211
Hi,

I have two Struts applications running on one Tomcat server. I am wondering if application A can access an application-scoped variable that is declared in the application B. I am asking because I am afraid that there might be some conflicts that will happen if ever some application-scoped variables were given the same names.

Thanks in advance,

Eugene
[ February 28, 2008: Message edited by: Eugene Abarquez ]

There's so much to learn in this industry, and not everybody has the necessary interest.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  72
The name "application-scoped" hints that the scope of the attribute is, well, the application. So there's no interference with any other application.
Eugene Abarquez
Ranch Hand

Joined: May 18, 2006
Posts: 211
Hi Ulf,

Thanks for pointing that out. However, I guess I need a more technical explanation of why that is the case. I had experiences with other servers before where application-contexts are shared to other applications. I guess this might not be the case with a server like Tomcat.

Eugene
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Originally posted by Eugene Abarquez:
I need a more technical explanation of why that is the case.

The J2EE specification was designed specifically so that applications could not interfere with one another. This is primarily a security issue. Suppose you had Company A and Company B with applications running on the same 3rd party server such as one run by an ISP. It would not be a good idea to allow Company B to snoop into data from Company A's application.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can two applications running on one server share an application-scoped variable?