Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

HTMLErrorWriter Class Reference

List of all members.

Detailed Description

HTML error page generator.

Author:
J.Butterworth, UCL
Version:
Date
2005-11-07 15:08:09 +0000 (Mon, 07 Nov 2005)
Revision
966

Definition at line 25 of file HTMLErrorWriter.java.


Static Public Member Functions

void write (PrintWriter out, Exception ex)
void write (BufferedWriter ofile, Exception ex)

Static Private Member Functions

void writeHeader (BufferedWriter ofile, String title)

Static Private Attributes

BufferedWriter ofile

Member Function Documentation

void write BufferedWriter  ofile,
Exception  ex
[static]
 

Print error page for a data base error.

Parameters:
ofile buffered writer
ex The exception.

Definition at line 56 of file HTMLErrorWriter.java.

00056                                                                 {
00057 
00058     try{
00059 
00060         writeHeader(ofile,"JetWeb Error");
00061 
00062         ofile.write("<PRE>"+ex.getMessage()+"</PRE>");
00063 
00064         //writeTrailer(ofile);
00065         ofile.close();
00066 
00067         // Write the stack trace to the log file.
00068         System.out.println("Writing exception error "+ex.getMessage());
00069         ex.printStackTrace(System.out);
00070 
00071     } catch (Exception e) {
00072         System.out.println("error");
00073     }
00074     }

void write PrintWriter  out,
Exception  ex
[static]
 

Print error screen for a JetWeb error based on a general Exception.

Parameters:
out The destination of the output screen.
ex The exception.

Definition at line 36 of file HTMLErrorWriter.java.

00036                                                            {
00037 
00038     try{
00039         ofile = new BufferedWriter(out);
00040         write(ofile,ex);
00041 
00042     } catch (Exception e) {
00043         System.out.println("error");
00044     }
00045     }

void writeHeader BufferedWriter  ofile,
String  title
[static, private]
 

Definition at line 76 of file HTMLErrorWriter.java.

00076                                                                        {
00077     try {
00078         ofile.write("<TITLE>"+title+"</TITLE>");
00079         ofile.newLine();
00080     }
00081     catch (IOException e) {
00082         System.out.println("Could not open output stream for error message.");
00083     }
00084     }


Member Data Documentation

BufferedWriter ofile [static, private]
 

Definition at line 27 of file HTMLErrorWriter.java.


The documentation for this class was generated from the following file:

Generated Wed Jan 17 09:14:27 GMT 2007