• 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

Multiple JVMs (default vs. non-default servlet context)

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I just did a mock exam from www.jdiscuss.com (the first one) and came across the following question:

Assuming that the servlet container is distributed across multiple JVMs, which of the following statements are correct?

A) A separate instance of a non-default servlet context will be available on each of the JVMs.
B) A separate instance of all servlet context will be avaible on each of the JVMs
C) The default servlet context will be present only on one of the JVMs.
D) There is only one instance of servlet contexts across all the JVMs.
E) None of the above.

Solution: A and C

Can somebody explain me, what is meant by default and non-default servlet context? I only found in HFSJ the following quote:

There is one ServletContext per JVM.



Thanks for your help in advance.
Bon
 
Ranch Hand
Posts: 48
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



- Each JVM will have one ServletContext instance.
-i.e, There is one ServletContext per JVM.


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



-But only one of the JVM's will have the active ServletContext instance at a time for a given application.
 
Bob Wheeler
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for answering, Patil.

Patil Niteen wrote:

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



-But only one of the JVM's will have the active ServletContext instance at a time for a given application.



So by default is meant an active ServletContext and by non-default an inactive ServletContext ??? No, can't be. I just guess that the term default is rubbish (and hopefully not used in the exam). That is very confusing

Cheers
Bob
 
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Bob.

Bob wrote: what is meant by default and non-default servlet context?



By default, Tomcat comes with defalut application for the purpose of starting, stopping, deploying, redeploying applications. The default servlet context relates to this default application. It comes as 'ROOT'.

Non-default servlet context relates to our own created applications.
reply
    Bookmark Topic Watch Topic
  • New Topic