1 28 29 package com.caucho.jstl; 30 31 import com.caucho.util.L10N; 32 33 import javax.servlet.jsp.JspException ; 34 import javax.servlet.jsp.tagext.TagSupport ; 35 import javax.servlet.jsp.tagext.TryCatchFinally ; 36 37 public class CatchTag extends TagSupport implements TryCatchFinally { 38 private static L10N L = new L10N(CatchTag.class); 39 40 private String var; 41 42 45 public void setVar(String var) 46 { 47 this.var = var; 48 } 49 50 53 public int doStartTag() 54 throws JspException 55 { 56 if (var != null) 57 pageContext.removeAttribute(var); 58 59 return EVAL_BODY_INCLUDE; 60 } 61 62 65 public void doCatch(Throwable t) 66 { 67 if (var != null) 68 pageContext.setAttribute(var, t); 69 } 70 71 74 public void doFinally() 75 { 76 } 77 } 78 79 | Popular Tags |