InterviewSolution
| 1. |
How Can You Invoke Other Web Resources (or Other Servlet / Jsp ) ? |
|
Answer» Servelt can invoke other Web RESOURCES in TWO WAYS: indirect and direct. Indirect Way : Servlet will return the resultant HTML to the browser which will point to another Servlet (Web resource) Direct Way : We can call another Web resource (Servelt / Jsp) from Servelt program itself, by using RequestDispatcher OBJECT. You can GET this object using getRequestDispatcher("URL") method. You can get this object from either a request or a Context. Servelt can invoke other Web resources in two ways: indirect and direct. Indirect Way : Servlet will return the resultant HTML to the browser which will point to another Servlet (Web resource) Direct Way : We can call another Web resource (Servelt / Jsp) from Servelt program itself, by using RequestDispatcher object. You can get this object using getRequestDispatcher("URL") method. You can get this object from either a request or a Context. |
|