1 16 package org.apache.taglibs.benchmark; 17 18 import java.util.*; 19 import javax.servlet.*; 20 import javax.servlet.jsp.*; 21 import javax.servlet.jsp.tagext.*; 22 23 32 33 public class Exclude extends TagSupport { 34 35 private Duration p; 37 public void release() { 38 p = null; 39 } 40 41 public int doStartTag() throws JspException { 42 p = (Duration) findAncestorWithClass(this, Duration.class); 43 if (p == null) 44 throw new JspTagException( 45 "<exclude> must be enclosed within " 46 + "<duration>"); 47 p.pauseTimer(); 48 return EVAL_BODY_INCLUDE; 49 } 50 51 public int doEndTag() throws JspException { 52 p.restartTimer(); 53 return EVAL_PAGE; 54 } 55 } 56 | Popular Tags |