Class LinkTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.BrowserInfoTag
org.deltava.taglib.html.ElementTag
org.deltava.taglib.html.LinkTag
- All Implemented Interfaces:
Serializable,IterationTag,JspTag,Tag
- Direct Known Subclasses:
CommandLinkTag,ScrollTag
A JSP tag to generate an HTML link.
- Since:
- 1.0
- Version:
- 7.4
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class org.deltava.taglib.html.ElementTag
_classes, _data, _outFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()Closes this link element by writing an >/A< tag.intOpens this link element by writing an >A< tag.voidrelease()Releases the tag's state variables.voidSets the anchor for this link.voidsetExternal(boolean isExternal) Marks this link as an external link.voidSets the label for this link.voidsetOnClick(String js) Sets the JavaScript onClick event for this link.voidSets the target frame for this link.voidSets the target URL for this link.protected voidValidates the tag to ensure a URL/onClick event has been set.Methods inherited from class org.deltava.taglib.html.ElementTag
getFormIndexCount, getName, getParentFormTag, setClassName, setID, setNumericAttr, setPageContext, setStyleMethods inherited from class org.deltava.taglib.BrowserInfoTag
getBrowserContext, passedCAPTCHAMethods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
Constructor Details
-
LinkTag
public LinkTag()Generates a new link tag.
-
-
Method Details
-
doStartTag
Opens this link element by writing an >A< tag.- Specified by:
doStartTagin interfaceTag- Overrides:
doStartTagin classElementTag- Throws:
JspException- if an error occurs;
-
doEndTag
Closes this link element by writing an >/A< tag.- Specified by:
doEndTagin interfaceTag- Overrides:
doEndTagin classTagSupport- Throws:
JspException- if an I/O error occurs
-
setUrl
-
setOnClick
Sets the JavaScript onClick event for this link.- Parameters:
js- the JavaScript code to execute when this link is clicked
-
setAnchor
-
setLabel
-
setTarget
Sets the target frame for this link.- Parameters:
targetFrame- the target frame name
-
setExternal
public void setExternal(boolean isExternal) Marks this link as an external link.- Parameters:
isExternal- TRUE if the link is external, otherwise FALSE
-
validateLink
Validates the tag to ensure a URL/onClick event has been set.- Throws:
IllegalStateException- if neither a URL nor onClick are present
-
release
public void release()Releases the tag's state variables.- Specified by:
releasein interfaceTag- Overrides:
releasein classElementTag
-