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
How do I know if java is running on linux?
What are its drawbacks of cgi?
What is the procedure of invoking different servlet in a different application?
What do you mean by cgi in servlet?
What is the difference between 2 types of servlets?
How httpservlet is different from the genericservlet?
What is a cookie What is the difference between session and cookie
Explain the custom jsp tags and the beans.
How can you run a servlet program?
What is called servlet container?
Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?
What is Servlets and explain the advantages of Servlet life cycle?
What are the jobs performed by servlets?
What do you mean by singlethreadmodel interface?
What is difference between PrintWriter and ServletOutputStream?