File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scope differences

 
rajiv shaw
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in distributed environment which on has WIDER Scope context or session
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
rajiv shaw
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2905
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic