What is difference between Forward() and sendRedirect()
methode?
Answer Posted / venkat
forward() method send source prg to target web resource prg
in same web application.and use source and target web
resource prg are use same req,res objects so will use data
in target web resource prg.
rd.forward(req,res)
sendRedirect() method send source web resource prg to target
web resource prg in same webapplication or two different web
applications in same server or different servers.and this
method will not use same req,res objects so if you want to
send data source to target web resource prg use query
string.
r.sendRedirect("srv2"?a=10);
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Servlet is pure java object or not?
What is the use of httpservletrequestwrapper and httpservletresponsewrapper?
What are different Authentication options available in Servlets.
What is the use of httpservletrequestwrapper?
Describe the phases of servlet lifecycle?
Explain the lifecycle of a servlet?
What is servlet initializer?
In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify
What is the difference between jsp and servlet life cycle?
How to get the IP address of client in servlet?
Why are servlets used?
How can we create deadlock situation in servlet?
What is context in servlet?
What's the servlet interface?
What is the difference between get and post methods?