1 16 17 package org.apache.taglibs.xtags.xpath; 18 19 import javax.servlet.ServletRequest ; 20 import javax.servlet.jsp.JspException ; 21 import javax.servlet.jsp.JspWriter ; 22 import javax.servlet.jsp.PageContext ; 23 import javax.servlet.jsp.tagext.BodyTagSupport ; 24 25 import org.apache.taglibs.xtags.util.JspNestedException; 26 27 32 public class AbstractBodyTag extends BodyTagSupport { 33 34 public AbstractBodyTag() { 35 } 36 37 38 40 protected void handleException( Exception e ) throws JspException { 41 if ( e instanceof JspException ) { 42 throw (JspException ) e; 43 } 44 else { 45 logError( e ); 46 throw new JspNestedException( e ); 47 } 48 } 49 50 51 protected void logInfo(String message) { 52 pageContext.getServletContext().log( "INFO: " + getClass().getName() + " : " + message ); 53 } 54 55 protected void logError(Throwable t) { 56 logError( t.getMessage() ); 57 t.printStackTrace(); 58 } 59 60 protected void logError(String message) { 61 pageContext.getServletContext().log( "Error: " + getClass().getName() + " : " + message ); 62 } 63 } 64 | Popular Tags |