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 called servlet mapping?
What is the life cycle of a servlet?
What are the steps that are involved in using the httpservlet class?
Which method is called when reference variable is passed in system.net?
Explain the difference between servlet and cgi?
Which event is fired at the time of setting, getting or removing attribute from application scope?
What do you mean by deployment descriptor?
What is meant by session? Tell me something about httpsession class?
What is cookie? Why is cookie used?
What are some advantages of storing session state in cookies?
What is servlet and how it works?
What is http servlet?
What are the objects involved when a servlet receives a call from client?
What is the inter-servlet communication?
When to use doget() and when dopost()?