can surpass a web-application in the same server (JVM), using getContext() to obtain a foreign context. (note: Tomcat setting required in the servlet.xml: <Context crossContext="true"> )
Which one should I use at any point of time?
You can use either one or a specific one when you want to surpass a web-application or when you want to use a relative path
I observe that a new RequestDispatcher instance gets created for every time the method is invoked. Can someone care to explain please?
It is not mandated by the specifications, so we (as programmers) don't know whether a RequestDispatcher object is created everytime and we should actually not care about it . The only thing we know is that the RequestDispatcher is an Interface and that the object implementing the RequestDispatcher interface can be obtained by calling getRequestDispatcher(String path)