Catch the error?
Java uses try/catch statements. A JSP is no different then Java. Catch any
errors from the bean and have the method throw an exception. Your JSP will
then make you catch the exception if you are using the method.
If you would like, check out this link. This JavaBean does just what you are
asking. It does not connect to a database, however it does catch the errors
and pass them for display on the JSP.
http://www.jspinsider.com/beans/beans/email/BeanMailer/index.html
Jayson Falkner
[EMAIL PROTECTED]
----- Original Message -----
From: "Bala Murali" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 22, 2000 7:01 PM
Subject: Exception in a bean method
> I am using one java bean(connecting to a database),if i get any error
then,how to pass the error message to jsp page.
>
> thx in advance
>
> rgds
> murali
>
> Disclaimer note:
>
> Confidential information may be contained in this e-mail and any files
transmitted with it ('Message'). If you are not the addressee indicated in
this Message (or responsible for delivery of this Message to such person),
you are hereby notified that any dissemination, distribution, printing or
copying of this Message or any part thereof is strictly prohibited. In such
a case, you should delete this Message immediately and advise the sender by
return e-mail. Opinions, conclusions and other information in this Message
that do not relate to the official business of Maxis shall be understood as
neither given nor endorsed by Maxis.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets