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 do you understand by actionform?
What are the tools in java?
Where javac is located?
you are to choose between two procedures,both of which copute the minimum value in an array of integers.one procedure returns the smallest integer if its array argument is empty. the other requires a nonempty array.which procedure should you choose and why?
What is authorization constraint?
Why is java used?
Which is best eclipse for 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 does resource adapt module contain?
What is j2ee specification?
What does enterprise javabeans module contain?
What is j2ee application model?
How do you make a class immutable in java?
What is home interface?
What is a j2ee container?