Requests which are part of a session can be handled by any number of JVMs, since the session migrates to whichever JVM contains the web resources required to satisfy the request. Please correct me if i am wrong.
what happens when a servlet in JVM1, forwards to/includes another servlet in JVM 2? In this case, the same request will be handled by 2 JVMs, not at the same time though.
One more question, when <c:import url=""> is used in a jsp, the resource to be sought can be in any JVM, and any web-app, how does that work?
Frits wrote -
With the RequestDispatcher you can forward to another web-app in the same JVM, but not to
public RequestDispatcher getRequestDispatcher(java.lang.String path):-
The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root. This method returns null if the servlet container cannot return a RequestDispatcher.
But Frits using getRequestDispatcher you can dispatch a request to only the current web-app
not any other web-app.Is not it so.
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.
The pathname must begin with a "/" and is interpreted as relative to the current context root. Use getContext to obtain a RequestDispatcher for resources in foreign contexts. This method returns null if the ServletContext cannot return a RequestDispatcher.