requestdispatch - servlet to servlet in iplanet( anyone plzzzzzzz!!!!)
Prithvi Raj
Greenhorn
Joined: Jul 13, 2001
Posts: 9
posted
0
hi, Please consider this scenario. I have written two projects in Proj1 and Proj2 (in iPlanet) Proj1 has a servlet called servlet1 Proj2 has a servlet called servlet2 In servlet1 i want to dispatch request (forward) to servlet2 getServletContext().getRequestDispatcher("Proj2/servlet2").forward(request,response); But the code does not forward request in iplanet. It gives an error like this error: SERVLET-fileext_not_set: Extension of file not found, while displaying static content the same code works fine in Netscape Application Server. i tried to forward request from one servlet1 to servlet3 in the same project in iplanet like this getServletContext().getRequestDispatcher("/servlet3").forward(request,response) it worked fine but the control came back to servlet1. why is it so. The servlets contain only system.out.println statements. can any one please tell me what to do. thanx in advance prithvim
prithvi
Bill Siggelkow
Ranch Hand
Joined: Jun 27, 2001
Posts: 57
posted
0
It sounds like that Proj1 and Proj2 are different web applications. If so, these web applications each have their own context and do not know about each other. Check your iPlanet documentation on this.
YOu may want to try servlet chaining. Instead of using the forward method use the include method. Then call the servlet you want to go to fro the request object. This will allow you to obtain the data in the request object of the other servlet(s). A reminder though in order to place the object(data) into the request object they must already have been instantiated within your current request object.
Prithvi Raj
Greenhorn
Joined: Jul 13, 2001
Posts: 9
posted
0
i do not wish to include because on include the control will come back to the including servlet. The problem is that the same context root on forward works for jsp but not for servlet.
Originally posted by kyle bober: YOu may want to try servlet chaining. Instead of using the forward method use the include method. Then call the servlet you want to go to fro the request object. This will allow you to obtain the data in the request object of the other servlet(s). A reminder though in order to place the object(data) into the request object they must already have been instantiated within your current request object.