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 is a deployment descriptor?
What is servlet api used for conneting database?
Explain servlet events?
Explain the servlet filter.
Which event is fired at the time of project deployment and undeployment?
How do you deal property files in servlet?
How to upload a file to the server using servlet?
What's the architecture of a servlet package?
Why servlet is faster than jsp?
What is servlet container. how it works?
Which method of the httpservletrequest object is used?
How would you create deadlock on your servlet?
Where do you define dispatcherservlet?
What are the differences between forward() method and sendredirect() methods?
When jsessionid is created?