1 16 17 package org.apache.taglibs.standard.tag.common.core; 18 19 import javax.servlet.jsp.JspException ; 20 import javax.servlet.jsp.tagext.TagSupport ; 21 22 import org.apache.taglibs.standard.resources.Resources; 23 24 35 36 public class ChooseTag extends TagSupport { 37 38 41 public ChooseTag() { 43 super(); 44 init(); 45 } 46 47 public void release() { 49 super.release(); 50 init(); 51 } 52 53 54 57 private boolean subtagGateClosed; 59 60 63 69 public synchronized boolean gainPermission() { 70 return (!subtagGateClosed); 71 } 72 73 77 public synchronized void subtagSucceeded() { 78 if (subtagGateClosed) 79 throw new IllegalStateException ( 80 Resources.getMessage("CHOOSE_EXCLUSIVITY")); 81 subtagGateClosed = true; 82 } 83 84 85 88 public int doStartTag() throws JspException { 90 subtagGateClosed = false; return EVAL_BODY_INCLUDE; 92 } 93 94 95 98 private void init() { 99 subtagGateClosed = false; } 101 } 102 | Popular Tags |