Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic