org.figure8.join.control.taglib
Class LoggedInTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.figure8.join.control.taglib.LoggedInTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class LoggedInTag
extends javax.servlet.jsp.tagext.BodyTagSupport

Body tag designed to protect view resources (ie. JSP fragment) depending on the login status of the current user. If you want that body content of LoggedInTag to be reserved to logged in user : set flag attribute to true. On the other hand, if you want that body content to be reserved to logged off user : set it to false.

Version:
$Revision: 1.1 $
Author:
Laurent Broudoux
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
LoggedInTag()
           
 
Method Summary
 int doEndTag()
          Get the body content.
 int doStartTag()
          Retrieve the current request and check if user is logged in using JoinAction.
 boolean getFlag()
           
 void release()
          Release all allocated resources.
 void setFlag(boolean flag)
           
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

LoggedInTag

public LoggedInTag()
Method Detail

getFlag

public boolean getFlag()
Returns:
The value of flag attribute

setFlag

public void setFlag(boolean flag)
Parameters:
flag - The value of flag attribute

doStartTag

public int doStartTag()
Retrieve the current request and check if user is logged in using JoinAction. Update the logged inner field and evaluate body content.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport

doEndTag

public int doEndTag()
Get the body content. If this content is not null and flag == logged, write the body content to the JspWriter.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport

release

public void release()
Release all allocated resources.

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.BodyTagSupport


Copyright © 2005-2008 Join. All Rights Reserved.