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?
<i>--Agrah Upadhyay--</i><br />Final Year B.Tech SCJP,SCWCD,SCBCD <br /> <br /><b>Now since the real test for any choice is having to make the same choice again,knowing full well what it might cost.</b>-Oracle
lalit upadheyay
Ranch Hand
Joined: Jun 20, 2005
Posts: 110
posted
0
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
posted
0
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
posted
0
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
posted
0
.......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
posted
0
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
posted
0
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.