Hi all,
I would like to use exception handling correctly in my servlet. Heres the
deal:
I have a servlet that has doPost and doGet methods - doPost and doGet
contain the same code shown below:
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws javax.servlet.ServletException, java.io.IOException
{
try{
performTask(request,response);
}
catch(ExceptionController exControll)
{
//for now we will send the error back
//latter we will add a class the returns an error page back
response.sendError(response.SC_INTERNAL_SERVER_ERROR,"ExceptionController
Reports: " + exControll.getMessage());
}
}
Now, the perfromTask method throws an ExceptionController(extends Exception)
instance which is caught in the doGet or doPost methods. Then I currently
send the error back to the web browser. The question is: is this good
exception handling??
Best Regards
Marc
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html