• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Scope differences

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in distributed environment which on has WIDER Scope context or session
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic