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 servlets are deployed in java?
How can we create deadlock situation in servlet?
What do you mean by web applications?
What methodology can be followed to store more number of objects in a remote server?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
What are the life cycle methods of the servlet?
What are the two important api's in for servlets?
How do cookies work in servlets?
Why are servlets used?
How to upload a file to the server using servlet?
What do you mean by url pattern in servlet?
What is the difference between CGI and Servlet?
What are the supporting protocol by HttpServlet ?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
What is httpservlet class?