FileDocCategorySizeDatePackage
LoggedInUserTag.javaAPI DocExample834Wed Jun 16 14:50:24 BST 2004com.darwinsys.jsptags

LoggedInUserTag

public class LoggedInUserTag extends javax.servlet.jsp.tagext.BodyTagSupport
LoggedInUser - include body content if the user is logged in as "user".
version
$Id: LoggedInUserTag.java,v 1.3 2004/06/16 18:50:24 ian Exp $

Fields Summary
private String
userName
Constructors Summary
Methods Summary
public intdoStartTag()
Invoked at the tag start transition; does the work

		String myLabel = null;

		HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
		return request.getRemoteUser().equals(userName) ? EVAL_BODY_INCLUDE : SKIP_BODY;

	
public voidsetUser(java.lang.String label)

param
label The role to check for (e.g., "admin");

		this.userName = label;