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
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
What is Request Dispatcher?
What's the servlet interface?
Are Servlets Thread Safe? How to achieve thread safety in servlets?
Where do you define dispatcherservlet?
What methods do you use in servlet - applet communication?
How do you configure a centralized error handler in servlets?
Explain servlet.
How can the session in servlet can be destroyed?
Is it good idea to create servlet constructor?
What are its drawbacks of cgi?
What is http servlet in java?
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 cgi and what are its drawbacks?
How we can create war file in servlet?