tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sven van 't Veer" <>
Subject Re: Using ResultSet object within JSP
Date Sat, 17 Jun 2000 11:18:56 GMT

>    The close() method throws SQLException and this exactly is the problem.
>    I don't want  try-catch within the JSP files. In general i don't want
> methods that throw exceptions within the JSP files.
>    Of course i can catch the SQLException within the dbClose() method but
> then i cannot handle it at the Browser level because i am within the bean.
>    Is this right ? ?
>    I hope i was clear enough.
>    Any ideas would be appreciated.
>   Alex.

I think it was clear enough, but tell me if I'm wrong. IMHO, the best
way to do this is within the JSP. From what I understand is that you
want to be able to show something went wrong. So you could create an
error.jsp, create the try/catch block and in case of an error, redirect
to error.jsp. Another option would be to pass the response object to
dbClose() and let the bean do the work and redirect to error.jsp or
errorservlet in case of an exception.


View raw message