1 15 package org.apache.tapestry.error; 16 17 import org.apache.commons.logging.Log; 18 import org.apache.tapestry.util.exception.ExceptionAnalyzer; 19 import org.apache.tapestry.web.WebRequest; 20 import org.apache.tapestry.web.WebSession; 21 22 26 public class RequestExceptionReporterImpl implements RequestExceptionReporter 27 { 28 private Log _log; 29 30 private WebRequest _request; 31 32 public void setLog(Log log) 33 { 34 _log = log; 35 } 36 37 public void setRequest(WebRequest request) 38 { 39 _request = request; 40 } 41 42 public void reportRequestException(String message, Throwable cause) 43 { 44 _log.warn(message, cause); 45 46 System.err.println("\n\n**********************************************************\n\n"); 47 48 System.err.println(message); 49 50 System.err.println("\n"); 51 52 WebSession session = _request.getSession(false); 53 54 if (session != null) 55 System.err.println(" Session id : " + session.getId()); 56 57 System.err.println("\nExceptions:\n"); 58 59 new ExceptionAnalyzer().reportException(cause, System.err); 60 61 System.err.println("\n**********************************************************\n"); 62 } 63 64 } | Popular Tags |