Difference between SendRedirect() and Forward() in JSP Servlet? Example

The difference between SendRedirect and forward is one of the classical interview questions asked during a java web developer interview. This is not just applicable for servlet but also for JSP in which we can use forward action or call sendRedirect() method from scriptlet. Before examining the difference between forward and SendRedirect let’s see what send Redirect method and the forward method does.

SendRedirect ():  

This method is declared in HttpServletResponse Interface.

Signature: void sendRedirect(String url)

تعليقات

المشاركات الشائعة من هذه المدونة

10 points about Java Heap Space or Java Heap Memory

How HashMap works in Java

10 examples of displaytag in JSP, Struts and Spring