wood burning stoves 2.0*
The moose likes Websphere and the fly likes difference in behaviour of requestDispatcher.forward() in WAS5.0 and WAS6.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Websphere
Bookmark "difference in behaviour of requestDispatcher.forward() in WAS5.0 and WAS6.1" Watch "difference in behaviour of requestDispatcher.forward() in WAS5.0 and WAS6.1" New topic
Author

difference in behaviour of requestDispatcher.forward() in WAS5.0 and WAS6.1

ketaki gujarathi
Greenhorn

Joined: Sep 09, 2009
Posts: 6
hi ,
In my servlet I am having following peice of code

try{

servletContext = getServletContext();
requestDispatcher = servletContext.getRequestDispatcher(jSPName);//valid jspName path n everythin is fine
requestDispatcher.forward(request, response);
System.out.println("servlet2");
}
catch {

System.out.println("Error Ocurred");


}
For Testing purpose I have removed one "<%" from my jsp file to throw the compilation error.
The following servlet & jsp is present in an EAR n is deployed in WAS6.1 fix pack 31 and also in WAS5.0
Following is the behaviour observed for
1. WAS 5.0
Since der is JSP compilation error , requestDispatcher.forward(req,res) throws an Exception which is caught and System.out.println("Error Ocurred"); is executed
2. WAS 6.1
Since der is JSP compilation error , requestDispatcher.forward(req,res) throws an Exception and System.out.println("servlet2"); is executed . however the exception thrown is not caught and no SOP in catch block is executed

As per my observation WAS5.0 uses servlet specification 2.3 and WAS6.1 uses 2.4

I would like to know why the behaviour is different and what changes needs to be done on either WAS side or in Servlet so that whn forward method throws exception it is caught in the calling method and SOP in catch block is executed.

Regards,
Ketaki
 
GeeCON Prague 2014
 
subject: difference in behaviour of requestDispatcher.forward() in WAS5.0 and WAS6.1