com.ora.jsp.tags.xmp
Class ClassicMenuItemTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
com.ora.jsp.tags.xmp.ClassicMenuItemTag
- All Implemented Interfaces:
- javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
- public class ClassicMenuItemTag
- extends javax.servlet.jsp.tagext.BodyTagSupport
This class is a custom action for conditionally inserting HTML links in a
navigation menu.
If the action is used in a page requested with a URL corresponding
to the page
attribute, only the HTML text is included.
Otherwise an HTML link (<a>...</a>
) element
is used to enclose the HTML text. The action also "URL rewrites" the page
URL (embeds a session ID, if needed).
- Version:
- 2.0
- Author:
- Hans Bergsten, Gefion software
- See Also:
- Serialized Form
Field Summary |
private java.lang.String |
page
|
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 |
Method Summary |
int |
doEndTag()
Writes either the body content as-is or enclosed in an HTML link
element to the current JspWriter, depending on if the request URI
matches the page attribute value or not. |
void |
release()
Releases all instance variables. |
void |
setPage(java.lang.String page)
Sets the page attribute. |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doAfterBody, doInitBody, doStartTag, 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 |
page
private java.lang.String page
ClassicMenuItemTag
public ClassicMenuItemTag()
setPage
public void setPage(java.lang.String page)
- Sets the page attribute.
- Parameters:
page
- the page URI value
doEndTag
public int doEndTag()
throws javax.servlet.jsp.JspException
- Writes either the body content as-is or enclosed in an HTML link
element to the current JspWriter, depending on if the request URI
matches the
page
attribute value or not.
The content is enclosed in an HTML link element
(<a>...</a>
) if the page
attribute doesn't correspond to the current page and the link
is "URL rewritten" (a session ID is added, if needed), and the
result is written to the current JspWriter.
- Throws:
javax.servlet.jsp.JspException
release
public void release()
- Releases all instance variables.