1 28 29 package com.caucho.jsp; 30 31 import com.caucho.log.Log; 32 33 import javax.el.ELContext; 34 import javax.servlet.jsp.JspContext ; 35 import javax.servlet.jsp.JspException ; 36 import javax.servlet.jsp.JspWriter ; 37 import javax.servlet.jsp.tagext.JspFragment ; 38 import javax.servlet.jsp.tagext.JspTag ; 39 import java.io.Writer ; 40 import java.util.logging.Logger ; 41 42 45 abstract public class JspFragmentSupport extends JspFragment { 46 private static final Logger log = Log.open(JspFragmentSupport.class); 47 48 protected PageContextImpl pageContext; 50 51 protected ELContext _jsp_env; 53 54 protected JspTag _jsp_parent_tag; 56 57 protected JspFragment _jspBody; 59 60 63 public JspContext getJspContext() 64 { 65 return this.pageContext; 66 } 67 68 74 public void invoke(Writer out) 75 throws JspException 76 { 77 JspWriter oldOut = null; 78 79 if (out != null) 80 oldOut = pageContext.pushBody(out); 81 82 try { 83 _jsp_invoke(pageContext.getOut()); 84 } catch (RuntimeException e) { 85 throw e; 86 } catch (Error e) { 87 throw e; 88 } catch (JspException e) { 89 throw e; 90 } catch (Throwable e) { 91 throw new JspException (e); 92 } finally { 93 if (oldOut != null) 94 pageContext.setWriter(oldOut); 95 } 96 } 97 98 101 abstract protected void _jsp_invoke(JspWriter out) 102 throws Throwable ; 103 } 104 | Popular Tags |