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


Please Help Members By Posting Answers For Below Questions

What is repaint in java?

497


What is frame in java?

495


What is javamail?

525


when i m calling java for web browser . so browser it's not support. show error in browser: internal error occur. java.lang.NoClassDefFoundError. will you give me solution why it's not starting browser.? is there any consult with .net framework2.0?

1555


What do you understand by connector?

504






Why is java important for internet?

452


What are the advantages in the use of spring for application development?

518


What is javabeans component?

519


What is java web technologies?

489


What is Connector architecture?

502


What is java advanced?

497


What is a web container in j2ee?

501


What is core java and j2ee?

502


What is tomcat in j2ee?

474


What is document root?

485