I have had a similar problem.  I wrote a custom exception class, extending
java.lang.Exception abd wrapping the original exception instance.

When an error occurs, I add a message containing localised and custom error
message info.  Then I propogate this exception to controller servlet and it
includes the corresponding JSP error page.

Here the error page displays it like a bean, not a with static content:

<pre>
<%@ page language="Java" isErrorPage="true" session=false %>
        <jsp:useBean id="errorBean" class="java.lang.Exception" scope="request" />
        <BR>
        <h1><FONT COLOR=red> An error has occurred while processing your request.
</FONT></h1>
        <BR>

        <jsp:getProperty name="errorBean" property="message" />
        <BR>

        <BR>
</pre>



It worked fine for me, but it may not be adequete solutin for big and
complex applications.

Bulent


>From: "Hines, Bill" <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Error handling in MVC model
>Date: Thu, 20 Jul 2000 14:33:36 -0400
>
>It's called exception handling. Any errors that occur at the lower levels
>of
>MVC, such as in your model (Java business logic) classes, should be caught
>and throw up a level (to the servlet, or controller level), and then to the
>JSP level, which should trigger your error page to be displayed.
>
>Bill Hines
>Hershey Foods
>
>-----Original Message-----
>From: Kumaravel Kandasami [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, July 20, 2000 9:38 AM
>To: [EMAIL PROTECTED]
>Subject: Error handling in MVC model
>
>Hi,
>
>I have a paculiar problem..
>i am coding in a MVC (JSP-Servlet-Java classes) model.
>I am confused on picking up a common strategy to be
>applied on handle Business Errors, System Errors and
>Screen Errors. Any ideas on this?
>
>Thanx in advance,
>Kumar
>
>
>__________________________________________________
>Do You Yahoo!?
>Get Yahoo! Mail - Free email you can access from anywhere!
>http://mail.yahoo.com/
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>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".
>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

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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

Reply via email to