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
How the typical servlet code look like ?
Explain how to improve Servlet Performance?
What are Servlets?
When servlet object is created?
What is the importance of init() method in Servlet ?
How can an existing session be invalidated?
What’s the use of the servlet wrapper classes??
What are all the advantages of servlet over cgi?
What is the difference between sendredirect() and forward() in a servlet?
How can you run a servlet program?
What are sessions in servlets?
Explain the different ways for servlet authentication?
What is the difference between using getSession(true) and getSession(false) methods?
explain the advantages of servlet life cycle?
What are the different ways we can maintain state between requests?