How do you pass the data from one servlet to another
servlet?
Answer Posted / vinod muda
In First Servlet i.e Test
String name = "Vinod";
request.setAttribute("name",name);
RequestDispatcher dis = request.getRequestDispatcher
("Test2");
dis.forward(request, response);
---------------------------------------
Now in Second Servlet i.e Test2
String name = (String) request.getAttribute("name");
Is This Answer Correct ? | 29 Yes | 10 No |
Post New Answer View All Answers
What is the difference between Servlets and Applets?
Who is responsible to create the object of servlet?
Describe servlet?
What are the different methods involved in generic servlet?
Differentiate between the web server and application server?
Explain servlet events?
What is the workflow of a servlet?
What is the difference between using getSession(true) and getSession(false) methods?
Why is servlet used?
Which protocol will be used by browser and servlet to communicate
How many servlet objects are created?
What is servlet and list its types?
What is a servlet-to-servlet communcation?
What is a java servlet?
What is the purpose of inter-servlet communication?