How to pass object from sevlet in domain A, to another servlet in domain B??
It is call servlet chaining, but can it be done on netscape application server 4???
-
Passing object between servlets (1 messages)
- Posted by: Chee Seng Yee
- Posted on: December 20 2000 03:30 EST
Threaded Messages (1)
- Passing object between servlets by Robert Baty on December 20 2000 17:09 EST
-
Passing object between servlets[ Go to top ]
- Posted by: Robert Baty
- Posted on: December 20 2000 17:09 EST
- in response to Chee Seng Yee
use request dispatching. Its an API in JSDK 2.1.
The objects you are trying to pass should be in the first
servlets request object, then after the request is dispatched interrogate with the second servlet.
something like this
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(HOME_JSP);
dispatch.forward(request, response);
when you do this the first servlet is giving up its response object so terminate the first servlet with a return; otherwise you will try and write to a response object twice.
rjb