org.apache.struts.taglib.html
Class LinkTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--javax.servlet.jsp.tagext.BodyTagSupport
              |
              +--org.apache.struts.taglib.html.BaseHandlerTag
                    |
                    +--org.apache.struts.taglib.html.LinkTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
FrameTag, NestedLinkTag, RewriteTag

public class LinkTag
extends BaseHandlerTag

Generate a URL-encoded hyperlink to the specified URI.

Version:
$Rev: 164530 $ $Date: 2005-04-25 04:11:07 +0100 (Mon, 25 Apr 2005) $
See Also:
Serialized Form

Field Summary
protected  java.lang.String action
          The module-relative action (beginning with a slash) which will be called by this link
protected  java.lang.String anchor
          The anchor to be added to the end of the generated hyperlink.
protected  java.lang.String forward
          The logical forward name from which to retrieve the hyperlink URI.
protected  java.lang.String href
          The hyperlink URI.
protected  java.lang.String indexId
          Name of parameter to generate to hold index number
protected  java.lang.String linkName
          The link name for named links.
protected static MessageResources messages
          The message resources for this package.
protected  java.lang.String module
          The module prefix (beginning with a slash) which will be used to find the action for this link.
protected  java.lang.String name
          The JSP bean name for query parameters.
protected  java.lang.String page
          The module-relative page URL (beginning with a slash) to which this hyperlink will be rendered.
protected  java.lang.String paramId
          The single-parameter request parameter name to generate.
protected  java.lang.String paramName
          The single-parameter JSP bean name.
protected  java.lang.String paramProperty
          The single-parameter JSP bean property.
protected  java.lang.String paramScope
          The single-parameter JSP bean scope.
protected  java.lang.String property
          The JSP bean property name for query parameters.
protected  java.lang.String scope
          The scope of the bean specified by the name property, if any.
protected  java.lang.String target
          The window target.
protected  java.lang.String text
          The body content of this tag (if any).
protected  boolean transaction
          Include transaction token (if any) in the hyperlink?
protected  boolean useLocalEncoding
           
 
Fields inherited from class org.apache.struts.taglib.html.BaseHandlerTag
accesskey, alt, altKey, bundle, defaultLocale, disabled, doDisabled, doReadonly, errorKey, errorStyle, errorStyleClass, errorStyleId, indexed, locale, log, loopTagStatusClass, loopTagStatusGetIndex, loopTagSupportClass, loopTagSupportGetStatus, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselect, readonly, style, styleClass, styleId, tabindex, title, titleKey, triedJstlInit, triedJstlSuccess
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext, parent, values
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
LinkTag()
           
 
Method Summary
protected  java.lang.String calculateURL()
          Return the complete URL to which this hyperlink will direct the user.
 int doAfterBody()
          Save the associated label from the body content.
 int doEndTag()
          Render the end of the hyperlink.
 int doStartTag()
          Render the beginning of the hyperlink.
 java.lang.String getAction()
           
 java.lang.String getAnchor()
           
 java.lang.String getForward()
           
 java.lang.String getHref()
           
 java.lang.String getIndexId()
           
 java.lang.String getLinkName()
           
 java.lang.String getModule()
           
 java.lang.String getName()
           
 java.lang.String getPage()
           
 java.lang.String getParamId()
           
 java.lang.String getParamName()
           
 java.lang.String getParamProperty()
           
 java.lang.String getParamScope()
           
 java.lang.String getProperty()
           
 java.lang.String getScope()
           
 java.lang.String getTarget()
           
 boolean getTransaction()
           
 boolean isUseLocalEncoding()
           
 void release()
          Release any acquired resources.
 void setAction(java.lang.String action)
           
 void setAnchor(java.lang.String anchor)
           
 void setForward(java.lang.String forward)
           
 void setHref(java.lang.String href)
           
 void setIndexId(java.lang.String indexId)
           
 void setLinkName(java.lang.String linkName)
           
 void setModule(java.lang.String module)
           
 void setName(java.lang.String name)
           
 void setPage(java.lang.String page)
           
 void setParamId(java.lang.String paramId)
           
 void setParamName(java.lang.String paramName)
           
 void setParamProperty(java.lang.String paramProperty)
           
 void setParamScope(java.lang.String paramScope)
           
 void setProperty(java.lang.String property)
           
 void setScope(java.lang.String scope)
           
 void setTarget(java.lang.String target)
           
 void setTransaction(boolean transaction)
           
 void setUseLocalEncoding(boolean b)
           
 
Methods inherited from class org.apache.struts.taglib.html.BaseHandlerTag
doErrorsExist, getAccesskey, getAlt, getAltKey, getBundle, getDisabled, getElementClose, getErrorKey, getErrorStyle, getErrorStyleClass, getErrorStyleId, getIndexed, getIndexValue, getJstlLoopIndex, getLocale, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getReadonly, getStyle, getStyleClass, getStyleId, getTabindex, getTitle, getTitleKey, isXhtml, lookupProperty, message, prepareAttribute, prepareEventHandlers, prepareFocusEvents, prepareIndex, prepareKeyEvents, prepareMouseEvents, prepareName, prepareOtherAttributes, prepareStyles, prepareTextEvents, setAccesskey, setAlt, setAltKey, setBundle, setDisabled, setErrorKey, setErrorStyle, setErrorStyleClass, setErrorStyleId, setIndexed, setLocale, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setReadonly, setStyle, setStyleClass, setStyleId, setTabindex, setTitle, setTitleKey
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
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, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

text

protected java.lang.String text
The body content of this tag (if any).

anchor

protected java.lang.String anchor
The anchor to be added to the end of the generated hyperlink.

forward

protected java.lang.String forward

The logical forward name from which to retrieve the hyperlink URI.

Usage note: If a forward config is used in a hyperlink, and a module is specified, the path must lead to another action and not directly to a page. This is in keeping with rule that in a modular application all links must be to an action rather than a page.


href

protected java.lang.String href
The hyperlink URI.

linkName

protected java.lang.String linkName
The link name for named links.

messages

protected static MessageResources messages
The message resources for this package.

name

protected java.lang.String name
The JSP bean name for query parameters.

page

protected java.lang.String page
The module-relative page URL (beginning with a slash) to which this hyperlink will be rendered.

action

protected java.lang.String action
The module-relative action (beginning with a slash) which will be called by this link

module

protected java.lang.String module
The module prefix (beginning with a slash) which will be used to find the action for this link.

paramId

protected java.lang.String paramId
The single-parameter request parameter name to generate.

paramName

protected java.lang.String paramName
The single-parameter JSP bean name.

paramProperty

protected java.lang.String paramProperty
The single-parameter JSP bean property.

paramScope

protected java.lang.String paramScope
The single-parameter JSP bean scope.

property

protected java.lang.String property
The JSP bean property name for query parameters.

scope

protected java.lang.String scope
The scope of the bean specified by the name property, if any.

target

protected java.lang.String target
The window target.

transaction

protected boolean transaction
Include transaction token (if any) in the hyperlink?

indexId

protected java.lang.String indexId
Name of parameter to generate to hold index number

useLocalEncoding

protected boolean useLocalEncoding
Constructor Detail

LinkTag

public LinkTag()
Method Detail

getAnchor

public java.lang.String getAnchor()

setAnchor

public void setAnchor(java.lang.String anchor)

getForward

public java.lang.String getForward()

setForward

public void setForward(java.lang.String forward)

getHref

public java.lang.String getHref()

setHref

public void setHref(java.lang.String href)

getLinkName

public java.lang.String getLinkName()

setLinkName

public void setLinkName(java.lang.String linkName)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getPage

public java.lang.String getPage()

setPage

public void setPage(java.lang.String page)

getAction

public java.lang.String getAction()

setAction

public void setAction(java.lang.String action)

getModule

public java.lang.String getModule()

setModule

public void setModule(java.lang.String module)

getParamId

public java.lang.String getParamId()

setParamId

public void setParamId(java.lang.String paramId)

getParamName

public java.lang.String getParamName()

setParamName

public void setParamName(java.lang.String paramName)

getParamProperty

public java.lang.String getParamProperty()

setParamProperty

public void setParamProperty(java.lang.String paramProperty)

getParamScope

public java.lang.String getParamScope()

setParamScope

public void setParamScope(java.lang.String paramScope)

getProperty

public java.lang.String getProperty()

setProperty

public void setProperty(java.lang.String property)

getScope

public java.lang.String getScope()

setScope

public void setScope(java.lang.String scope)

getTarget

public java.lang.String getTarget()

setTarget

public void setTarget(java.lang.String target)

getTransaction

public boolean getTransaction()

setTransaction

public void setTransaction(boolean transaction)

getIndexId

public java.lang.String getIndexId()

setIndexId

public void setIndexId(java.lang.String indexId)

isUseLocalEncoding

public boolean isUseLocalEncoding()

setUseLocalEncoding

public void setUseLocalEncoding(boolean b)

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Render the beginning of the hyperlink.

Support for indexed property since Struts 1.1

Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Save the associated label from the body content.
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Render the end of the hyperlink.
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

release

public void release()
Release any acquired resources.
Overrides:
release in class BaseHandlerTag

calculateURL

protected java.lang.String calculateURL()
                                 throws javax.servlet.jsp.JspException
Return the complete URL to which this hyperlink will direct the user. Support for indexed property since Struts 1.1
Throws:
javax.servlet.jsp.JspException - if an exception is thrown calculating the value


Copyright 2000-2006 - The Apache Software Foundation