what is difference between redirect and forward method?

Answer Posted / vipin gupta trainer

There is a difference between the
HttpResponse.sendRedirect() method and the
RequestDispatcher.foward() method .


the sendRedirect() method leverage Https built in redirect
features to send a message back to the client and foce the
visitors Browser to request a new page .


the forward() method transfer the HttpServletRequest and
HttpServletResponse methods to the indicated file on the
web server. the forward() method never communicates with
the visitors browser .

Is This Answer Correct ?    19 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we avoid direct access of jsp pages from client browser?

621


Which tag is used for error handling in jsp pages?

462


Explain the advantages in jsp?

519


What is the difference between servletcontext and pagecontext?

529


in jsf page i use two dropdown list.i.e state & district.if state dropdown is selected then & then district is enable.what should be my code.

2082






What is server context?

493


What is jsp and servlets?

488


How to restrict page errors display in a JSP page?

579


What is meant by session management?

477


Can a subsequent request be accessed with one’s servlet code, if a request attribute is already sent in his jsp?

513


Explain the difference between include directive and include action in jsp?

516


Can we call servlet from jsp?

469


Can you explain what is jsp page life cycle?

527


What is a scriptlet?

510


What are the different types of jsp tags?

479