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 do you understand by mime type?
What is servlet and its advantages?
What are the types of an http request?
What is difference between server and servlet?
Whether we can get deadlock situation in servlets?
How do we translate jsp?
What are the disadvantages of storing session state in cookies?
How do you design microservices?
How do I know if java is running on linux?
What is the use of httpservletresponsewrapper?
What is the type of method for sending request from http server?
What is webservlet?
Explain the difference between jsp and servlet?
Define context initialization parameters.
What are the important functions of filters?