1 53 54 106 107 package com.Yasna.forum.tags; 108 109 import java.io.*; 110 import javax.servlet.*; 111 import javax.servlet.jsp.*; 112 import javax.servlet.jsp.tagext.*; 113 import javax.servlet.http.*; 114 import com.Yasna.forum.tags.*; 115 116 150 public class MemberOfGroupTag extends TagSupport 151 { 152 private String name = null; 153 private Boolean value = null; 154 155 160 public final int doStartTag() throws JspException 161 { 162 boolean result = false; 163 164 try { 166 AccountTag at = (AccountTag)this.findAncestorWithClass(this, 167 Class.forName("com.Yasna.forum.tags.AccountTag")); 168 result = at.isMember(name); 169 } catch(Exception e) { 170 } 171 172 if( value == null ) { 173 if( result ) 174 return EVAL_BODY_INCLUDE; 175 return SKIP_BODY; 176 } 177 if( value.booleanValue() == result ) 178 return EVAL_BODY_INCLUDE; 179 180 return SKIP_BODY; 181 } 182 183 186 public final void setName(String nam) 187 { 188 name = nam; 189 } 190 191 196 public void setValue(String str) 197 { 198 value = new Boolean (str); 199 } 200 } 201 | Popular Tags |