home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / APCHSSL2.ZIP / OS2HTTPD / public / htdocs / gsp / status / viewexceptions.gsp < prev   
Encoding:
Text File  |  1999-02-01  |  1.6 KB  |  65 lines

  1. <html>
  2.  <head><title>GSP Exception Viewer</title></head>
  3.  
  4.  <body bgcolor="#ffffff">
  5.  
  6. <h1>GSP Exception Viewer</h1>
  7.  
  8. <java>
  9.   // Change this to control number of exceptions shown per page
  10.   int number = 20;
  11.  
  12.   long total = 0;
  13.   int offset = 0;
  14.   try { offset = Integer.parseInt(request.getForm().getValue("offset")); }
  15.   catch(Exception e) { }
  16.  
  17.   Logger el = application.getLogger();
  18.   LoggedException list[] = null;
  19.   if(el != null) {
  20.     total = el.getExceptionCount();
  21.     list = el.getExceptions(number, offset);
  22.   }
  23.   int upper = offset + number;
  24.   if(list != null) {
  25.     upper = offset + list.length;
  26.   }
  27.  
  28. </java>
  29.  
  30. Total Exceptions: `total`
  31. <br>
  32. Currently viewing exceptions: `offset+1` - `upper`
  33. <p>
  34.  
  35. <java>
  36.   if(offset > 0) {
  37.     out.println("[ <a href=\"viewexceptions.gsp?offset=" + (offset - number)
  38.     + "\">Back</a> ]  ");
  39.   }
  40.   if(total > (offset + number)) {
  41.     out.println("[ <a href=\"viewexceptions.gsp?offset=" + (offset + number)
  42.     + "\">Next</a> ]  ");    
  43.   }
  44.  
  45.   out.println("[ <a href=\"status.gsp\">Status Page</a> ]");
  46.  
  47.   if(list != null && list.length > 0) {
  48.     out.println("<p><table border=0 cellpadding=4 cellspacing=0>");
  49.     out.println("<tr bgcolor=#99ccff><td><b>Date</b></td><td><b>Message</b></td></tr>");
  50.  
  51.     String bgcolor[] = { "#ffffff", "#cccccc" };
  52.     for(int i = 0; i < list.length; i++) {
  53.       out.print("<tr bgcolor=" + bgcolor[i % 2] + "><td>");
  54.       out.print(list[i].getDate());
  55.       out.print("</td><td><a href=\"exception_detail.gsp?offset=" + 
  56.                 (offset + i) + "\">");
  57.       out.print(list[i].getMessage());
  58.       out.println("</a></td></tr>");
  59.     }
  60.     out.println("</table>");
  61.   }
  62. </java>
  63.   
  64.  </body>
  65. </html>