Package org.deltava.taglib.content
Class AuthenticatedUserFilterTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.content.AuthenticatedUserFilterTag
- All Implemented Interfaces:
Serializable
,IterationTag
,JspTag
,Tag
A JSP tag to filter out content that is displayed for authenticated users only.
- Since:
- 1.0
- Version:
- 7.0
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
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
-
Method Summary
Modifier and TypeMethodDescriptionint
doEndTag()
Renders the JSP closing tag and releases state.int
Renders the start of the JSP tag and applies the filter.void
release()
Releases the tag's state variables.void
setAnonymous
(boolean isAnon) Toggles the reverse switch for this tag and includes content for anonymous users only.void
Sets the request attribute to save the user object into.Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
Constructor Details
-
AuthenticatedUserFilterTag
public AuthenticatedUserFilterTag()
-
-
Method Details
-
setVar
Sets the request attribute to save the user object into.- Parameters:
name
- the attribute name
-
setAnonymous
public void setAnonymous(boolean isAnon) Toggles the reverse switch for this tag and includes content for anonymous users only.- Parameters:
isAnon
- TRUE if tag behavior should be reversed, otherwise FALSE
-
release
public void release()Releases the tag's state variables.- Specified by:
release
in interfaceTag
- Overrides:
release
in classTagSupport
-
doStartTag
Renders the start of the JSP tag and applies the filter.- Specified by:
doStartTag
in interfaceTag
- Overrides:
doStartTag
in classTagSupport
- Returns:
- EVAL_BODY_INCLUDE if authenticated, otherwise SKIP_BODY
- Throws:
JspException
- if an error occurs
-
doEndTag
Renders the JSP closing tag and releases state.- Specified by:
doEndTag
in interfaceTag
- Overrides:
doEndTag
in classTagSupport
- Returns:
- EVAL_PAGE always
- Throws:
JspException
- never
-