This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
guys, we can forward request using request's or context's requestDispatcher.In which case we will use request, and in which case we will use context? also whats the difference between / and ../. Please help
We can forward a request either by using the RequestDispatcher() of ServletContext interface or the ServletRequest interface, the point when to use ServletContext or ServletRequest is that the ServletRequest looks for the resources in the same context (same webapp) to which the invoking servlet belongs.
Moreover the pathname used in the RequestDispatcher() of ServletContext must begin with a "/" which is an absolute path.
The pathname used in the RequestDispatcher() of ServletRequest interface can be an absolute path or a relative path means it can start with “/” or “../..”.