Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes Register and obtain information with JVM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Register and obtain information with JVM" Watch "Register and obtain information with JVM" New topic
Author

Register and obtain information with JVM

Andrew Cly
Greenhorn

Joined: Jun 02, 2004
Posts: 3
In servlet code, can we register a piece of information with the
underlying JVM, and retrieve it later (by another web module servlet)?

If a servlet in one web module registered some information with JVM, then
a servlet in another web module can read that information out during
init() time, and know the existence of the former servlet. The two
servlets can even be the same class but deployed in two web modules.

Can we do that in our code? Or it is generally impossible because the
servlet container will disable such communication?

Thanks,
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
You might try the java.lang.System setProperty() and getProperty() methods but the SecurityManager settings may not let you do that.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Register and obtain information with JVM
 
Similar Threads
HttpSession, session ID, cookie, jsession ID, confusions and confirmations..
find context root of other web module in same application
accessing session variables when we use sendRedirect
Distributed applications
How many instances of the JVM exist in a collocated application?