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
How do we translate jsp?
What is the use of send redirect () method?
What is context in servlet?
What is the GenericServlet class?
What is the workflow of a servlet?
Why is init() method is used in servlets?
What is a server side include (ssi)
Explain jsessionid and when is it created?
How do cookies work in servlets?
What are the different ways we can maintain state between requests?
What is the difference between using getSession(true) and getSession(false) methods?
What is the capacity the doget can send to the server?
When a servlet accepts a call from a client, it receives two objects. What are they?
What are the servlet events?
What is the use of servlet context?