What is the difference between sendRedirect() and forward()?
in what situations do we have to use send redirect()
instead of forward().

Answer Posted / bindhu solomon

When we use forward, then servlet container forwards all
request to the target page. but in the case sendRedirect,
container makes a new request to the target Page.
So in forward , url link doesn't change but in sendRedirect
url line change . Because container makes a new request,
sendRedirect is much slower than forward.

If a target page has no relation with current
page , then we can use sendRedirect(I think so....)

Is This Answer Correct ?    35 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is java gui dead?

501


Why java is a platform?

458


What is j2ee server?

542


What is javamail?

525


What is the preferred size of a component in java?

442






How do I become a java developer?

483


What are the different types of events in java?

417


Hi Friends. I want complete technical flow of j2ee project with following technologies. jsp , servlet , Struts , Hibernate , (should follow mvc-2 design pattern) . with DAO ,DTO SERVICE layers .

4393


How java is reliable?

474


What is document root?

485


Difference between load and get method?

550


Differentiate between .ear, .jar and .war files.

591


What is build tool in java?

489


What is a java developer?

466


What is meant by j2ee?

494