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
Why doesn’t a servlet include main()?
What are the different methods of session management in servlets?
What is servlet in tomcat?
Which are the different ways you can communicate between servlets?
Write a hello world program using servlets.
What does the term localization refer to?
Who is responsible to create the object of servlet?
Explain the servlet filter.
Explain servlet life cycle?
What is httpservlet class?
What do you mean by deployment descriptor?
Why do we need servlet filter?
Why session tracking is needed?
What is called Scriptlet?
What is difference between cookies and httpsession?