Difference between Include, Forward and sendRedirect in
Servlet?

Answer Posted / shyam babu

include: will include the output of another resource(jsp,
servlet etc )in our current file. and response is generated
from current file

forward: will forward the current request to the forwarding
page & response is generated from forwarding opage

sendRediect: will redirect to the page specified in the
sendRedirect method but it won't send the
same request to the new page but forward will send the same
request to the new page

Is This Answer Correct ?    8 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different ways we can maintain state between requests?

580


What do you mean by cgi in servlet?

633


When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?

568


Explain load on start-up and its importance?

601


Can a jsp be called using a servlet?

586






Which httpsession object is used to view and manipulate information about a session?

736


Explain the differences between jsp and servlet.

546


Explain in brief the directory structure of a web application?

572


Which java framework is most popular?

581


What is httpservlet and how it is different from genericservlet?

612


Describe some assignments that are executed by servlet container?

588


Is servlet a framework?

543


What do you mean by chaining in servlet?

576


How do you invoke a Servlet? What is the difference between doPost method and doGet method?

647


what do you understand by url rewriting?

548