How to pass a requrest object of one servlet as a request
object to another servlet?
Answers were Sorted based on User's Feedback
Answer / hari
Use RequestDispatcher to pass a requrest object of one
servlet as a request object to another servlet.
One way of implementing this operation ,
RequestDispatcher rD = null;
rd = request.getRequestDispatcher("xxx.jsp (or) servlet");
rD.forward(request,response);
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / ravikiran(aptech mumbai)
using request.setAttribute("key",value) in the first servlet
and request.getAttribute("key") in the second servlet
Is This Answer Correct ? | 5 Yes | 3 No |
Answer / priya
in an any web application when we have to pass object from
one servlet to another then we use request dispatcher.the
request dispatcher is used by using request.setAttribute
("key",value) in the first servlet and request.getAttribute
("key")in the second servlet.
Is This Answer Correct ? | 0 Yes | 1 No |
How httpservlet is different from the genericservlet?
which type of data passing is used in realtime?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
What are the types of protocols supported by httpservlet ?
What is the difference between genericservlet and httpservlet
Differentiate between the web server and application server?
Which exception is thrown if servlet is not initialized properly?
Can we fetch the attributes related to a servlet on a different servlet?
What is setattribute in servlet?
Can we use the constructor, instead of init(), to initialize servlet?
Which interface must be implemented by all servlets?
What is difference between get and post method?