• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet

 
Shrawan Bhageria
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could anyone please tell me the different brtween RequestDispatcher.forword() and RequestDispatcher.include() mathod.
thanx

SCJP 1.4
SCWCD 1.4 (preparing)
[ June 20, 2005: Message edited by: Shrawan Bhageria ]
 
amar verma
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shrawan,

forward and include are used for entirely different purpose,

A Servlet that invokes RequestDispatcher.include() retains overall responsibility for the service request,handling the response to the client.
In this case, the Servlet has the opportunity to do any sort of clean up after all the nested invocations have completed.

But in case of forward() method , it transfers control to the designated dynamic resource.
and that resource is responsbile to service the request, send response back to the client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic