| Author |
forward() and include() methods
|
deepashree deval
Greenhorn
Joined: Oct 20, 2008
Posts: 12
|
|
|
Can anybody give me a real time scenario where can i use forward() method and in which situation i should go for the include()method for redirection
|
 |
vipin joseph
Greenhorn
Joined: Feb 17, 2008
Posts: 4
|
|
Include method is used when we want to include some external files in our Servlet (eg: html, javascripts). If you want to show some advertisements in your sevlet code you can include the avertisement page as an image or html file. We use forward method to navigate the request and response object to another resouce on the same server. suppose we want to assign a jsp to display the contents we can navigate from the servlet to jsp using forward method. here servlet is reponsible for data processing and jsp is for display (MVC pattern follows this)
|
 |
 |
|
|
subject: forward() and include() methods
|
|
|