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
How to read request headers from servlets?
Explain load on start-up and its importance?
When a servlet accepts a call from a client, it receives two objects. What are they?
How do you deal property files in servlet?
How do you invoke a servelt?
How do servlets work?
Servlet is pure java object or not?
What is the major difference between context parameter and context attribute?
What is the purpose of dispatcherservlet properties?
What are the drawbacks of cgi?
If servlet receives multiple requests, how many objects will it create?
How printwriter is different from servletoutputstream?
How do you get the ip address of the client in servlet?
What do you mean by cgi and what are its drawbacks?
What is preinitialization of a servlet?