• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between the forward and include methods

 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people,

I just try to find the difference between the forward and include methpds from the RequestDistpacher. As far I i understand with forward you can pass the actaul request to other servlets. But I not really shore about what the include.


Regards M
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using forward, you can pass the request to other servlet or JSP. Using include
you can add the content of any other jsp or html page content (as being
part of the page) to the page.

The content of the included page is pasted to the including page.


Thanks,
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check here http://faq.javaranch.com/view?ScwcdHints
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks but now I have an other question, why I need to do this ?
I can pack the needed information in the response and send to the others by using the forward method.

Regards
M

P.S.
Please excuse my ignorance in this domain, I am fresh here, I just read (and try to process) the SCWDC Exam Study Kit.
[ June 17, 2007: Message edited by: Mihai Radulescu ]
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can think of forward as in forward to somewhere else. Include is including where you are and staying there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic