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 ?
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
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.
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