Forward and Redirects: The forward and redirect operations both replace content. The current page or output stream is terminated, and is replaced with the output of the specified page.
Forwards: Both <jsp:forward> and RequestDispatcher.forward() are what I refer to as "server-side" redirects. The redirect operation is performed in the server side, and the browser is unaware of the change. If page1.jsp forwards to page2.jsp, the browser's address bar will still show page1.jsp
Redirects: The response.sendRedirect() is what I call a "client-side" redirect. The redirect operation is passed to the browser, which is aware of the change. If page1.jsp redirects to page2.jsp, the browser's address bar be updated to show page2.jsp.
Forwards vs. Redirects: You choose between forwards and redirects depending on how you want the browser to be affected. Forward operations are faster, because all the processing happens server-side. Redirect operations update the browser history, however, which is often desirable.
If you forward between page1 and page2, if the user's clicks the "refresh" or "reload" button, both page1 and page2 are executed a second time. On the other hand, if you use a client-side redirect, the browser's address information is updated. If the user clicks refresh, only page2 are re-executed.
Hi sirisha redirect means the control will goes to anothre url for example mailcity.com is one famous site that will be purchesed by lycos.com when ever the user login to the mailcity.com the request will goes to lycos or it will give status code as 302.requestdispatcher will have two methods include() & forward(),In forward the control will goes to another jsp,and in include just we will include jsp.
We're pleased to have you here with us in the servlets forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.