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
Explain the difference between servletconfig and servletcontext in servlet?
What is the advantage of Servlets when compared with other server side technologies?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
How we can create war file in servlet?
What are the differences between servlet context vs servlet config?
Explain the working of service() method of a servlet.
What is the difference between using getSession(true) and getSession(false) methods?
Is java servlet still used?
How do you define a servlet?
What are the different methods involved in generic servlet?
How can we invoke another servlet in a different application?
What is load-on-startup in servlet?
Write a program to show the functionality of doget and dopost method?
What is meant by servlet? What are the parameters of the service method?
How we can get ip address of client in servlet?