How do you pass the data from one servlet to another
servlet?
Answer Posted / kuru
for example if you want to pass your name from one servlet
to another,
in fiest servlet file....
String name = "Tom"
request.setAttribute("name",name);
RequestDispatcher dis = request.getRequestDispatcher
("Servlet2");
request.Forward(request,response);
in second servlet file....
request.getAttribute("name");
//this line will display "Tom"
Is This Answer Correct ? | 46 Yes | 20 No |
Post New Answer View All Answers
What are the jobs performed by servlets?
What is a servlet context object?
When servlet is loaded?
What exactly is a servlet?
What do you mean by session tracking and also explain its techniques?
What is meant by a web application
When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?
What are the difference between RMI and Servlets?
What do you mean by mime type?
Explain web application directory arrangement?
Differentiate between the web server and application server?
What are the advantages of cookies?
What are the phases of a servlet life cycle?
Explain the war file?
What is the workflow of a servlet?