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
What is document root?
Describe action form?
What is included in j2ee?
What is java transaction api (jta)?
Who gave the name java?
I am newbie in J2EE & looking for strong basic behind each concept as, Why do we use private access specifier before each variable of type property bcoz ultimately to access it outside the class we use public method as getter & setter ? If we use getter & setter to access it outside the class so better we make variable as public so that it is easily available outside of the class... Please guide me why do we use as private ????
What is distributed application?
Is eclipse written in java?
What is event in java?
What do you mean by the component contract?
What is java technology stack?
Why awt is used in java?
What is jbutton in java?
Is core java and j2se same?
What is a jbutton in java?