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 use of send redirect () method?
How will two or three servlets interact or communicate with each other?
Why do we have servlet filters?
How do we share data using 'getservletcontext ()?
What is the difference between jsp and servlet life cycle?
What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?
What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?
What are the difference between RMI and Servlets?
What is http servlet? Explain with the help of an example.
Which protocol will be used by browser and servlet to communicate
What are the types of protocols supported by httpservlet ?
How are filters?
What do you mean by url pattern in servlet?
How do I support both get and post from the same servlet?
How to rectify errors in java servlet while compilation?