1 16 17 package org.apache.taglibs.request; 18 19 import java.util.*; 20 import javax.servlet.*; 21 import javax.servlet.http.*; 22 import javax.servlet.jsp.*; 23 import javax.servlet.jsp.tagext.*; 24 25 57 58 public class IsUserInRoleTag extends TagSupport 59 { 60 private boolean value = true; 61 private String role = null; 62 63 68 public final int doStartTag() throws JspException 69 { 70 boolean result = ((HttpServletRequest)pageContext.getRequest()).isUserInRole(role); 71 72 if( value == result ) 73 return EVAL_BODY_INCLUDE; 74 75 return SKIP_BODY; 76 } 77 78 83 public final void setValue(boolean value) 84 { 85 this.value = value; 86 } 87 88 94 public final void setRole(String str) 95 { 96 role = str; 97 } 98 } 99 | Popular Tags |