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 j2ee architecture?
Where can I find java developers?
What is DDP?
What is j2ee tutorial?
What is a jpanel in java?
What do you mean by j2ee module?
what is direct link to download swing ebook,applet,ejb,core java
Since we can create managed bean by two ways as, we can define the bean name in faces-config.xml file so that page can use that OR we can write annotation on bean class so that it is automatically assign to page but I want to know which one is good programming practice ? And also mention disadvantage of other which should not prefer ... Thanking you...
What is mean by j2ee?
What do you understand by j2ee?
What is application assembler?
What is ebxml?
What is devops in java?
What does application client module contain?
What is j2ee product provider?