home *** CD-ROM | disk | FTP | other *** search
- <html>
- <head><title>GSP Exception Viewer</title></head>
-
- <body bgcolor="#ffffff">
-
- <h1>GSP Exception Viewer</h1>
-
- <java>
- // Change this to control number of exceptions shown per page
- int number = 20;
-
- long total = 0;
- int offset = 0;
- try { offset = Integer.parseInt(request.getForm().getValue("offset")); }
- catch(Exception e) { }
-
- Logger el = application.getLogger();
- LoggedException list[] = null;
- if(el != null) {
- total = el.getExceptionCount();
- list = el.getExceptions(number, offset);
- }
- int upper = offset + number;
- if(list != null) {
- upper = offset + list.length;
- }
-
- </java>
-
- Total Exceptions: `total`
- <br>
- Currently viewing exceptions: `offset+1` - `upper`
- <p>
-
- <java>
- if(offset > 0) {
- out.println("[ <a href=\"viewexceptions.gsp?offset=" + (offset - number)
- + "\">Back</a> ] ");
- }
- if(total > (offset + number)) {
- out.println("[ <a href=\"viewexceptions.gsp?offset=" + (offset + number)
- + "\">Next</a> ] ");
- }
-
- out.println("[ <a href=\"status.gsp\">Status Page</a> ]");
-
- if(list != null && list.length > 0) {
- out.println("<p><table border=0 cellpadding=4 cellspacing=0>");
- out.println("<tr bgcolor=#99ccff><td><b>Date</b></td><td><b>Message</b></td></tr>");
-
- String bgcolor[] = { "#ffffff", "#cccccc" };
- for(int i = 0; i < list.length; i++) {
- out.print("<tr bgcolor=" + bgcolor[i % 2] + "><td>");
- out.print(list[i].getDate());
- out.print("</td><td><a href=\"exception_detail.gsp?offset=" +
- (offset + i) + "\">");
- out.print(list[i].getMessage());
- out.println("</a></td></tr>");
- }
- out.println("</table>");
- }
- </java>
-
- </body>
- </html>