html
Tag link


Render an HTML anchor or hyperlink

Renders an HTML <a> element as an anchor definition (if "linkName" is specified) or as a hyperlink to the specified URL. URL rewriting will be applied automatically, to maintain session state in the absence of cookies. The content displayed for this hyperlink will be taken from the body of this tag.

The base URL for this hyperlink is based on the href attribute.

Normally, the hyperlink you specify will be left unchanged (other than URL rewriting if necessary). However, there are two ways you can append one or more dynamically defined query parameters to the hyperlink -- specify a single parameter with the paramId attribute (and its associated attributes to select the value), or specify the property attribute to select a SourceBean list bean that contains one or more parameter ids and corresponding values.

To specify a single parameter, use the paramId attribute to define the name of the request parameter to be submitted. To specify the corresponding value, specify the paramName attribute - The named property on service context (optionally scoped by the value of the paramScope attribute) must identify a value that can be converted to a String.

If you prefer to specify a SourceBean list that contains all of the request parameters to be added to the hyperlink, specify only the name attribute - The named service context data (optionally scoped by the value of the scope attribute) must identify a SourceBean list containing the parameters.

As the SourceBean list is processed, every element is assumed to be formed by the name and value attributes; these respective values are used as query parameters to be appended to the hyperlink. The value associated with each SourceBean must be either a String or an object whose toString() method will be called.

Additionally, you can request that the current transaction control token, if any, be included in the generated hyperlink by setting the transaction attribute to true. You can also request that the href is calculated based on the alias and aliasRelated parameters. You can also request that an anchor ("#xxx") be added to the end of the URL that is created by any of the above mechanisms, by using the anchor attribute.



Tag Information
Tag Classit.eng.spago.taglib.html.LinkTag
TagExtraInfo ClassNone
Body ContentJSP
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
accesskeyfalsetruejava.lang.String

The keyboard character used to move focus immediately to this element.

aliasfalsetruejava.lang.StringName of the alias to be used instead of the href attribute.
aliasRelatedfalsetruejava.lang.StringString to be appended to the alias attribute if present.
anchorfalsetruejava.lang.String

Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character.

hreffalsetruejava.lang.String

The URL to which this hyperlink will transfer control if activated. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify the href attribute.

indexedfalsetruebooleanValid only inside of logic:iterate tag. If true then indexed parameter with name from indexId attribute will be added to the query string. Indexed parameter looks like "index[32]". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag.
indexIdfalsetruejava.lang.StringBy this attribute different name for the indexed parameter can be specified. Take a look to the "indexed" attribute for details.
bundlefalsetruejava.lang.StringThe servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.
Since:
Struts 1.2.5
linkNamefalsetruejava.lang.String

The anchor name to be defined within this page, so that you can reference it with intra-page hyperlinks. In other words, the value specified here will render a "name" element in the generated anchor tag.

onblurfalsetruejava.lang.String

JavaScript event handler that is executed when this element loses input focus.

onclickfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a mouse click.

ondblclickfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a mouse double click.

onfocusfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives input focus.

onkeydownfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a key down event.

onkeypressfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a key press event.

onkeyupfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a key up event.

onmousedownfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a mouse down event.

onmousemovefalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a mouse move event.

onmouseoutfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a mouse out event.

onmouseoverfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a mouse over event.

onmouseupfalsetruejava.lang.String

JavaScript event handler that is executed when this element receives a mouse up event.

paramIdfalsetruejava.lang.String

The name of the request parameter that will be dynamically added to the generated hyperlink. The corresponding value is defined by the paramName and (optional) paramProperty attributes, optionally scoped by the paramScope attribute

paramNamefalsetruejava.lang.String

The name of a JSP bean that is a String containing the value for the request parameter named by paramId (if paramProperty is not specified), or a JSP bean whose property getter is called to return a String (if paramProperty is specified). The JSP bean is constrained to the bean scope specified by the paramScope property, if it is specified.

paramScopefalsetruejava.lang.String

The scope within which to search for the bean specified by the paramName attribute. If not specified, all scopes are searched.

propertyfalsetruejava.lang.String

The name of a SourceBean list attribute of service context, whose return value must containe the query parameters to be added to the hyperlink. Every SourceBean present in list has to contain two attribute: name and value. These attributes are used to create the query string.

scopefalsetruejava.lang.String

The scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched.

stylefalsetruejava.lang.String

CSS styles to be applied to this element.

styleClassfalsetruejava.lang.StringCSS stylesheet class to be applied to this HTML element (renders a "class" attribute).
styleIdfalsetruejava.lang.StringIdentifier to be assigned to this HTML element (renders an "id" attribute).
tabindexfalsetruejava.lang.String

The tab order (ascending positive integers) for this element.

targetfalsetruejava.lang.String

The window target in which the resource requested by this hyperlink will be displayed, for example in a framed presentation.

titlefalsetruejava.lang.String

The advisory title for this hyperlink.

titleKeyfalsetruejava.lang.String

The message resources key for the advisory title for this element.

transactionfalsetrueboolean

If set to true, any current transaction control token will be included in the generated hyperlink.

useLocalEncodingfalsetrueboolean

If set to true, LocalCharacterEncoding will be used, that is, the characterEncoding set to the HttpServletResponse, as prefered character encoding rather than UTF-8, when URLEncoding is done on parameters of the URL.


Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.