What is the difference between sendRedirect() and forward()?
in what situations do we have to use send redirect()
instead of forward().

Answer Posted / ajay

sendRedirect() means it's client side redirect at that time
new parameters can be added.(i.e HttpRequest, HttpResponse)

forward() meand it's server side redirect at that time same
parameters can be used.


forward() can be used forwarding the request from one
servlet to jsp.(i.e with in the container).

redirect() can be used redirecting the one jsp to another
jsp(i.e different containers).

Is This Answer Correct ?    56 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is j2ee architecture?

473


What is entity reference?

497


What is j2ee technology?

542


What is a java application server?

483


What is jbutton in java?

495






How will you explain cdata?

549


for example we are login into the irctc server from there it will go to the selected bank and deduct amount and come back to the irctc. so if we are developing this in java means will it be run on the same session. but as per my knowledge bank is separate and irctc is separate URL's so it will use two different sessions then how it is maintaining same session through out application and even it uses the payment gateway? how it is working can any one help me on that??

3858


Define the struts in the j2ee framework?

494


What is Document Object Model?

545


What is deployer?

546


What is jlayeredpane java?

464


What is java ee technologies?

460


What are struts?

511


What is main method in java?

495


What is gridlayout in java?

464