"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Best wishes,
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Originally posted by Sam Cala:
hi,
Can I foward a request thru RequestDispatcher to a servlet that exists in another context but in the same server...
If yes how, bcoz, forward and include methods of RequestDispatcher takes a parameter of a relative path(begin from '/'), so how can we forard or include from a different context of the same server.
Originally posted by Maulin Vasavada:
hi,
my 2 cents. what i understand is,
servlet context is each web application we r having on the tomcat. so i fully agree with Pradeep.
<B>each servlet runs in ONE jvm. so we have as many JVMs as number of servlets. thats true for any java program. </B> whenever we run one java program with "java" command line it creates one instance of JVM. if run the same program second time (parallely i mean) it will create another JVM instance.
and of course the Tomcat process is only ONE.
hope i am clear here.
regards
maulin.
Best wishes,
Originally posted by Sam Cala:
I tend to disagree that we have as many JVMs as number of servlets. To be precise, I should say that There is only one JVM in a server which handles all the requests and there are as many Contexts as Web applications in a server...
![]()
Sun Certified J2EE Architect for the J2EE Platform (Part 1)<br />Sun Certified Web Component Developer for the J2EE Platform<br />Sun Certified Programmer for the Java 2 Platform
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
No.Originally posted by Ravish Kumar:
so May I say that there are as many JVM and ServletContext as many WebApps are in one Tomcat ???
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
The HttpSession (where you should store everything pertaining to that specific user that you want to keep track of in memory) will have been shared across the two: no problems there.Originally posted by James Horton:
What happens if in a distributed application, one request from the client goes to server1 and the subsequent request from the same client goes to server2?
You won't be able to access it. So you have to take care in the types of attributes you store in the ServletContext. But I must say that in my career so far this has rarely been a restriction: stuff stored in the session tends to be cached data of various kinds, pools, Singleton instances, that kind of thing. Generally resources that inherently cannot be shared across JVMs or that are recreatable anywhere.If I store an attribute in the SevletContext on server1, am I not handicapped in not able to access that attribute directly from ServletContext on server2 since the same ServletContext is not shared by both server1 and server2 for the same web application.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Peter den Haan:
Generally resources that inherently cannot be shared across JVMs or that are recreatable anywhere.
- Peter
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd