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 can we upload the file to the server using servlet?
What is servlet lazy loading?
Explain the architechure of a servlet?
Explain the role of dispatcherservlet and contextloaderlistener.
What is the use of servlet wrapper classes?
What is called a session?
Differentiate between the print writer and servlet output stream?
What are life cycle methods of a servlet?
Is tomcat a servlet container?
What is cookie? Why is cookie used?
How native code can be used in a servlet?
What is a servlet?
Define context initialization parameters.
What are the ways to handle multi-threading in servlets?
How the typical servlet code look like ?