001    package railo.runtime.ext.tag;
002    
003    import javax.servlet.jsp.tagext.TryCatchFinally;
004    
005    import railo.runtime.exp.AbortException;
006    import railo.runtime.exp.PageServletException;
007    
008    
009    /**
010     * extends Body Support Tag eith TryCatchFinally Functionality
011     */
012    public abstract class BodyTagTryCatchFinallyImpl extends BodyTagImpl implements TryCatchFinally{
013    
014            @Override
015            public void doCatch(Throwable t) throws Throwable {
016                    if(t instanceof PageServletException) {
017                        PageServletException pse=(PageServletException)t;
018                        t=pse.getPageException();
019                    }
020                if(bodyContent!=null) {
021                            if(t instanceof AbortException){
022                                    bodyContent.writeOut(bodyContent.getEnclosingWriter());
023                            }
024                            bodyContent.clearBuffer();
025                    }
026                    throw t;
027            }
028    
029            @Override
030            public void doFinally() {
031                    
032            }
033            
034    }