• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RequestDispatcher + Include

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic