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 load-on-startup in servlet?
Write a simple servlet program to print the contents of html.
What is meant by cookies?
How do you invoke a servelt?
Explain how to improve Servlet Performance?
What is servlet container?
What is the use of servletconfig interface?
Explain the lifecycle of a servlet?
What do you mean by scope object and what are its types?
What is the life cycle of a servlet?
What do you mean by annotations in servlet?
How does java thread pool work?
What do you mean by a filter and how does it work?
Explain the role of dispatcherservlet and contextloaderlistener.
What do you mean by singlethreadmodel interface?