This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Multiple JVMs (default vs. non-default servlet context) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Multiple JVMs (default vs. non-default servlet context)" Watch "Multiple JVMs (default vs. non-default servlet context)" New topic
Author

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

Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
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


SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Patil Niteen
Ranch Hand

Joined: Dec 10, 2009
Posts: 48

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.


SCJP 1.4, SCWCD 5
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
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
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple JVMs (default vs. non-default servlet context)
 
Similar Threads
mock question regarding distributed application across multiple JVMs
Defaul ServletContext ...??? Question
Servlet context
distributed across multiple JVM
Default servlet context