Originally posted by Ravi Singh:
...
b is correct becuase if the application is used in distributed environment then the application will have multiple context
c is correct if the application is running in single JVM.
..
Originally posted by Jan Sterk:
Aren't you confused with sessions?
Ah well, meantime I found something about it in HF (p.255).
You probably mean that there's one context
object per JVM. But they're completly identical, copies of each other, all the time. From the programmer's point of view, there's only one context object. If a servlet in JVM A adds or changes an attribute in the context, then a servlet in JVM B can use that attribute and gets the same new value.
Charles Lyons also states in his book 'Study Companion': one application, one context.
Clearly that's what the question refers to, otherwise it would have used the
word 'object'.
Please correct me if I'm wrong about it. These kind of things are hard to check empirical.
Btw, it was me who was confused with sessions
There's one session object only, migrating from one JVM to the other..
[ June 18, 2008: Message edited by: Jan Sterk ]
[ June 18, 2008: Message edited by: Jan Sterk ]
[ June 18, 2008: Message edited by: Jan Sterk ]