What’s the Difference between sendRedirect() and Forward tag?

Basically sendRedirect() and <jsp:forward…> does the same task. Both of them redirect the page to a particular address. Still there is a small difference.

Forward tag is used when you like to keep the visitor in the same application. But when you like to take him to another page which is not included in your application you should use sendRedirect().

The funda is when we are using the sendRedirect() we are sending the control to the redirected page. Where as using <jsp:forward…> we are just browsing another page keeping the control.

Advertisements
This entry was posted in JSP. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s