what is the main use of the RequestDispatch object, how we
this in realtime project

Answers were Sorted based on User's Feedback



what is the main use of the RequestDispatch object, how we this in realtime project..

Answer / 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

what is the main use of the RequestDispatch object, how we this in realtime project..

Answer / gangadhar m

hi,

The main use of RequestDispatcher is when u want to transfer
control from one webapplication to another webapplication
deployed in same server(its web/ app server).

If you want to transfer control from one webapplication to
another webapplication those are deployed in different
servers( Ex one in Tomcat, another in Weblogic) use
response.sendRedirect("url"); method.

if u want any confirmation please call me.

my mobile no is 09096272808

Is This Answer Correct ?    4 Yes 4 No

what is the main use of the RequestDispatch object, how we this in realtime project..

Answer / chandra sekar

The main use of Request Dispatcher Objest is to share
request object between two servlets

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More J2EE Interview Questions

Is visual studio good for java?

0 Answers  


What is java ee architecture?

0 Answers  


What is ebxml?

0 Answers  


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?

0 Answers  


why we are using XML?

14 Answers   TCS,






Is c++ more secure than java?

0 Answers  


where our package shoud be kept in the application whenwe want to import that package in the jsp application?

1 Answers  


Why is java used?

0 Answers  


What is mean by connection pooling?

0 Answers  


Whats the O/p of the below code snippet ? And explain how does it imply the concept of call-by-value/call-by reference. (PS : Pls ignore syntax errors) public class One { public oneA(){ sop ("Into One--");} } public class Two extends One{ public twoT(){ sop ("Into Two--"); } } public class Home { One a; Two t; public static void main(argv[]) { sop ("In Home--"); sop(a.oneA()); sop(t.oneA()); sop(a.twoT()); sop(t.twoT()); } }

4 Answers   Wipro,


Is java 100 percent pure object oriented?

0 Answers  


How to call main class with in main class?

2 Answers   IBM, Infosys,


Categories