what is the main use of the RequestDispatch object, how we
this in realtime project
Answer Posted / sagar
RequestDispatch is mainly used to shipping request
attributes from one servlet/jsp to another servlet/jsp.
While doing this we first create RequestDispatch instance
with string url as parameter to where request data to be
shipped. Then we cal reqDispatchReference.forward
(request,response) method. This is something like assigning
work to third party.
Ex:(to forward request data from Servlet1 to page2.jsp)
class Servlet1 extends HttpServlet{
public void service(... request,... response){
...........
RequestDispatcher rd=request.RequestDispatcher("page2.jsp");
try
{
rd.forward(request,response);
}
catch(Exception e)
{
}
}
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How does event listener work in java?
What is authorization?
What is general entity?
What is mean by connection pooling?
Is java ee and j2ee same?
What are container services?
What is actionform?
What is form-based authentication?
What is application configuration resource file?
Why class is used in java?
What is the best java course?
Is core java and j2se same?
What is distributed application?
public class ActionSearchBean extends
GenericSearchBean
Is tomcat a java ee?