KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > golfShop > presentation > xmlc > ErrorHandler


1 /*
2  * Enhydra Java Application Server
3  * The Initial Developer of the Original Code is Lutris Technologies Inc.
4  * Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies
5  * Inc.
6  * All Rights Reserved.
7  *
8  * The contents of this file are subject to the Enhydra Public License Version
9  * 1.0 (the "License"); you may not use this file except in compliance with the
10  * License. You may obtain a copy of the License at
11  * http://www.enhydra.org/software/license/epl.html
12  *
13  * Software distributed under the License is distributed on an "AS IS" basis,
14  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
15  * License for the specific language governing rights and limitations under the
16  * License.
17  *
18  * $Id: ErrorHandler.java,v 1.1 2004/08/16 09:45:47 slobodan Exp $
19  */

20
21 package golfShop.presentation.xmlc;
22
23 import org.enhydra.xml.xmlc.*;
24 import org.enhydra.xml.xmlc.html.*;
25 import com.lutris.logging.*;
26 import com.lutris.appserver.server.*;
27 import com.lutris.appserver.server.httpPresentation.*;
28 import org.w3c.dom.*;
29 import golfShop.presentation.xmlc.utilities.*;
30
31 /**
32  * Error handler presentation for GolfShop. This logs the error and
33  * displays a friendly screen to the used.
34  */

35 public class ErrorHandler implements HttpPresentation {
36     /**
37      * Entry.
38      */

39     public void run(HttpPresentationComms comms)
40         throws HttpPresentationException {
41
42         LogChannel chan = Enhydra.getLogChannel();
43         chan.write(Logger.ERROR, "application error", comms.exception);
44         ErrorHandlerHTML htmlObj = (ErrorHandlerHTML)comms.xmlcFactory.create(ErrorHandlerHTML.class);
45         comms.response.writeDOM(htmlObj);
46     }
47 }
48
Popular Tags