Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RequestDispatcher + Include  RSS feed

 
Maneesh Chauahn
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have some confusion of the include method of the RequestDispatcher Interface . What is the use of this method .

Moreover if i used include method of the RequestDispatcher where the flow goes. For example

public class servlet1 extends HttpServlet {

public void doPost(HttpServletRequest request, HttpServletResponse response){

String path = "hello.jsp";

RequestDispatcher requestDispatcher = h.getRequestDispatcher(path);

requestDispatcher.include(request,response);

}

}

Now my question is that include only includes the response of the hello.jsp , but at the end doPost method where the control goes ??? or program hangs after that include as it not find any thing where it shd foward the control

Thanks in advance for prompt answer

Maneesh Chauhan
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Maneesh Chauahn:
What is the use of this method .


This is well-explained in the API documentation for the RequestDispatcher class.

but at the end doPost method where the control goes


It's just a method like any other Java method. When the method ends, control returns back to the caller of the method. Which in this case is a class inside the servlet container.

Thanks in advance for prompt answer


It's best not to be too pushy about things.
[ March 08, 2007: Message edited by: Bear Bibeault ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!