Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic