File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes web application distributed 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 "web application distributed" Watch "web application distributed" New topic
Author

web application distributed

agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
If we say web application is distributed,What is our context?Does it mean that only servlets,Jsps and HTML etc are distributed and NOT DD?Then if somme listener classes are distributed there will be some listeners uninvoked if they reside only on one JVM.Right?
lalit upadheyay
Ranch Hand

Joined: Jun 20, 2005
Posts: 110
not, distributed apps. means replicated apps. on different servers on different locations( that includes the exact directory replica on each server including web.xml). Here we have foreign context.


SCJP1.4, SCWCD1.4, SCBCD5.0(working on...)
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
If web application is distributed , one request now sets attributes in ServletContext in one JVM and then if another request comes and goes to another JVM,then that attribute set to first ServletContext will not be available in ServletContext of another JVM..........??When it must be available!
Sub swamy
Ranch Hand

Joined: Oct 02, 2002
Posts: 121
When an app is distributed, there would be a separate instance of ServletContext(and ServletConfig) in each of the JVM's. The default ServletContext would be in one of the JVM's while a non-default instance of the ServletContext would be present in each of the JVM's.

Only the session object is shared across the different JVM's i.e there exists only one instance of session object.

This is what HFSJ has to say about distributable applications.

To answer u'r question - yes, if you set in ServletContext of JVM A, the value would not be available in JVM B.
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
.......It means when our web application one day ship to be distributed ,we should CHANGE our code so that they must not set context attributes!
Yogesh Hingmire
Ranch Hand

Joined: Dec 06, 2005
Posts: 61
I do not see any reason for a code change or doing away with the context attributes.

If you perform the same activity (which changes a attribute for a context in one VM), in the second VM the same effect will take place.

Also, HF is quite clear abt it, Servlet contexts and ServletConfig will be replicated in their respective VM's while session objects will have to be migrated from one VM to another.

would help if u can you please let us know ur exact requirement.
Yogesh Hingmire
Ranch Hand

Joined: Dec 06, 2005
Posts: 61
by same eddect i mean when you perform the same activity on the context in the another VM
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web application distributed