aspose file tools*
The moose likes Servlets and the fly likes Scope differences Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Scope differences" Watch "Scope differences" New topic
Author

Scope differences

rajiv shaw
Greenhorn

Joined: Jun 25, 2008
Posts: 3
in distributed environment which on has WIDER Scope context or session
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

Howdy rajiv shaw,

Welcome to JavaRanch

As such the term 'wider' means the 'reachability'? I think you meant to say the Application or ServletContext as Context here.

As such the application scope is within the environment it lives across all the sessions. It is basically tied up with the container's execution not the user's. Whereas Session is basically for the continued activity of one user. In a single environment, ServletContext or Application has a wider scope.

In a distributed environment, i guess 'session' can have more scope as it can be shared across the JVMs. Not very sure about the Application Context.

[Corrected the term JRE as JVM]
[ June 25, 2008: Message edited by: Raghavan Muthu ]

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
rajiv shaw
Greenhorn

Joined: Jun 25, 2008
Posts: 3
is it possible to set session object in one web application say web1 and get it in another web apllication say web2.both web application are running in same JVM??
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Hi ,

In a distributed environment, i guess 'session' can have more scope as it can be shared across the JREs


i just wanna know How you can achieve that ? I googled it out and found the different links with same arguments , here is the sample

As per this thread , JSP specification prohibits this, and they are discussing about two different webapps on same JVM, Then , how ll it comes into "scope" on different JVM ??


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

Hi Sagar,

Thanks for the link. Here is one more link which is in the same url you have passed. http://forum.java.sun.com/thread.jspa?forumID=33&threadID=259394. Kindly see Sudha_mp's reply on that.

Generally, the term 'distributed' means 'across JVMs' and NOT the single JVM. In such case, it needs to be explicitly shared by some other means.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scope differences