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.Tag ; 35 import javax.servlet.jsp.tagext.TagSupport ; 36 37 40 public class OtherwiseTag extends TagSupport { 41 private static L10N L = new L10N(OtherwiseTag.class); 42 43 46 public int doStartTag() 47 throws JspException 48 { 49 Tag parent = getParent(); 50 51 if (! (parent instanceof ChooseTag)) 52 throw new JspException (L.l("c:otherwise tag must be contained in a c:choose tag.")); 53 54 ChooseTag chooseTag = (ChooseTag) parent; 55 56 if (chooseTag.isMatch()) 57 return SKIP_BODY; 58 59 chooseTag.setMatch(); 60 61 return EVAL_BODY_INCLUDE; 62 } 63 } 64 | Popular Tags |