1 53 54 106 107 package com.Yasna.forum.tags; 108 109 import java.io.*; 110 import java.util.*; 111 import javax.servlet.*; 112 import javax.servlet.jsp.*; 113 import javax.servlet.jsp.tagext.*; 114 import javax.servlet.http.*; 115 import com.Yasna.forum.tags.*; 116 117 139 public class AnonymousUserTag extends TagSupport 140 { 141 private Boolean value = null; 142 143 146 public final int doStartTag() throws JspException 147 { 148 boolean result = false; 149 150 YazdRequest jr = (YazdRequest)pageContext.getAttribute("yazdUserRequest", 152 PageContext.REQUEST_SCOPE); 153 if( jr == null ) 154 throw new JspException("Yazd anonymous_user tag could not find YazdRequest"); 155 156 result = jr.isAnonymous(); 157 158 if( value == null ) { 159 if( result ) 160 return EVAL_BODY_INCLUDE; 161 } else { 162 if( value.booleanValue() == result ) 163 return EVAL_BODY_INCLUDE; 164 } 165 166 return SKIP_BODY; 167 } 168 169 174 public void setValue(String str) 175 { 176 value = new Boolean (str); 177 } 178 } 179 | Popular Tags |