How do you pass the data from one servlet to another
servlet?
Answer Posted / debojit
First of all u have to set the value by setAttribute()
method such as:
getServletContext().setAttribute("variableName",object);
Then u have to forward that request to other servlet by
using that procedure,
RequestDispatcher rd=getServletContext
().getRequestDispatcher("/servlet");
rd.forward(request,response);
U can get that information from that servlet by using the
method::
getServletContext().getAttribute("variableName");
| Is This Answer Correct ? | 23 Yes | 10 No |
Post New Answer View All Answers
What are different Authentication options available in Servlets.
What are the uses of servlet and what is servlet chaining?
What is load-on-startup in servlet?
What is servlet collaboration?
How do you create a cookie using servlet?
Explain the differences between jsp and servlet.
What is the web server used for running the Servlets?
What do you mean by session tracking and also explain its techniques?
What do you mean by chaining in servlet?
Write the code to get the server information in servlet.
What is a web container and what is its responsibility?
When servlet is loaded?
What is servlet interface?
Why HttpServlet class is declared abstract?
What is meant by a servlet?