• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet context

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming that the servlet container is distributed across multiple JVMs, which of the following statements are correct?



Options

Select 2 correct options.

A separate instance of a non-default servlet context will be available on each of the JVMs.


A separate instance of all servlet context will be avaible on each of the JVMs



The default servlet context will be present only on one of the JVMs.


There is only one instance of servlet contexts across all the JVMs.


None of the above.

As per me.. the first two that are bold are correct. Bt the answer is 1 and 3. Please explain
 
geeta lalchandani
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the comment .... from someone ...

There is one instance of the ServletContext interface associated with each web application
deployed into a container. In cases where the container is distributed over many virtual machines,
there is one instance per web application per VM.
Servlets that exist in a container that were not deployed as part of a web application are implicitly
part of a �default� web application and are contained by a default ServletContext. In a
distributed container, the default ServletContext is non-distributable and must only exist on
one VM.


How is this possible??
 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you (or anyone) explain me, what is default servlet context?

... then I will be able to answer your question.

Thanks.
 
geeta lalchandani
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wish i knew it...
thats the first time i read it..
was browsing through some dummy questions.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my suggestion.
1. Go to the authoritative servlet API site and download the servlet API documents.
2. Search the API for default servlet context (and variations)
3. Report back to the class what you find.

Bill
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There would be one context per JVM. But session is something that only one per user per application( not JVM).Imagin a cluster having a load balancer to redirect the client requests.For example the first the file load balancer redirects the request to Node 1 and for the second request from the user the load balancer directs the request to Node 2.But still the session is with Node 1..so node 1 passivated the session and sends that to node 2 , where again this gets activated.
I know this is nothing much to do with your exact question.
Hope this helps.
 
geeta lalchandani
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks william.
Yes there exists something that is the default servlet context.As per the specs..

Servlets in a container that were not deployed as part of aWeb application are
implicitly part of a �default� Web application and have a default ServletContext.
In a distributed container, the default ServletContext is non-distributable and
must only exist in one JVM.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had never run across that before, now it has me wondering how you have a servlet that is "not deployed as part of a Web application."

Bill
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic