I am aware of the technical differences between response.sendRedirect() and <jsp:forward...> i.e. that the first one sends an instruction to the browser to request the specified page, and the second simply sends the specified page.

However, can anyone tell me why one should be used instead of the other?

Erik Runia

Generally I use forward when I'm sending a page that is within the same site i am sending from, ie you are on index.jsp and sending them to the signup.jsp or whatever.

I use sendRedirect() when I'm pushing them out to an outside link, ie you are you yoursite.com/index.jsp and are sending them to yahoo.com.