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
Elucidate servlet attributes and its scope?
Is tomcat a servlet container?
What is servlet and its life cycle?
What are the ways to handle multi-threading in servlets?
Define declaration.
What are the life cycle methods of a servlet?
How the servlet is loaded?
Why the concept of single thread model interface is used?
What are the advantages of Servlet over CGI?
What is the structure of the http response
Which java framework is most popular?
Difference between java beans & servlets?
What are some advantages of storing session state in cookies?
What is servlet collaboration?
What are important features of Servlet 3?