GeeCON Prague 2014*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question on distributed application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question on distributed application" Watch "question on distributed application" New topic
Author

question on distributed application

Timber Lee
Ranch Hand

Joined: Oct 14, 2002
Posts: 157
Assuming that the servlet container is distributed across multiple JVMs, which of the following statements are correct?
answers include a seperate instance of a non-default servlet context will be availalbe on each of the JVMs.
my questions :
1 how to undestand the answer? a instance is seperated in different JVMs or there is a instance in each JVM?
2 what is different between non-default servlet context and default servlet context ?


SCJP<br />SCWCD<br />SCEA
Timber Lee
Ranch Hand

Joined: Oct 14, 2002
Posts: 157
are there any answer?
Adrian Muscalu
Ranch Hand

Joined: May 08, 2000
Posts: 73
1) I'd say that the answer you've provided is correct. There is one instance of servlet context in every JVM (except for the default servlet context).
2) The default servlet context corresponds to the default web-application (if enabled). This one is not distributed.
Hope this helps,
Adrian Muscalu


SCJP2, SCWCD
Maha Annadurai
Ranch Hand

Joined: Oct 27, 2002
Posts: 87
From Servlet 2.3 spec,
SRV.3.2 Scope of a ServletContext Interface
There is one instance object of the ServletContext interface associated with each
web application deployed into a container. In cases where the container is
distributed over many virtual machines, a web application will have an instance of
the ServletContext for each VM.
Servlets in a container that were not deployed as part of a web 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 VM.
Hafizur Rahman
Ranch Hand

Joined: Sep 05, 2002
Posts: 98
I am green regarding to Distributable web application. Would anyone answer my questions please?
1. Is Tomcat's ROOT is an example of default web context? If yes, it cannot be distributable.
2. If I make a new context called scwcd, is other than default? If yes, it can be made distributable.
Please clear my understanding.
---------------
Hafizur Rahman
SCJP2(94%)


SCJP 2(94%), SCBCD 5.0(86%), SCDJWS(86%), SCEA 5 (I-73%, II/III-88%)
The illiterate of the 21st century will not be those who cannot read and write, but those who cannot learn, unlearn, and relearn. - Alvin Toffler
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Hafizur Rahman:
1. Is Tomcat's ROOT is an example of default web context? If yes, it cannot be distributable.
Yes, that is my understanding. The default context is home to such facilities as the JSP servlet (which is mapped to *.jsp and translates JSP pages into proper servlets).
2. If I make a new context called scwcd, is other than default? If yes, it can be made distributable.
Yes, and yes.
- Peter
yi zhu
Ranch Hand

Joined: Sep 10, 2002
Posts: 41
Hi all,
What should I do in code to make web application distributable? I know that every object stored in session should implement Serializable. Are there more restrictions?
Thanks
 
GeeCON Prague 2014
 
subject: question on distributed application