html
Tag img


Render an HTML img tag

Renders an HTML <img> element with the image at the specified URL. Like the link tag, URL rewriting will be applied automatically to the value specified in src to maintain session state in the absence of cookies. This will allow dynamic generation of an image where the content displayed for this image will be taken from the attributes of this tag.

The base URL for this image is calculated directly based on the value specified in src, or indirectly by looking up a message resource string based on the srcKey. You must specify exactly one of these attributes.

Normally, the src that 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 src URL -- specify a single parameter with the paramId attribute (at its associated attributes to select the value), or specify the property attribute to select a SourceBean list 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 object 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 property 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.

You can specify the alternate text for this image (which most browsers display as pop-up text block when the user hovers the mouse over this image) either directly, through the alt attribute, or indirectly from a message resources bundle, using the bundle and altKey attributes.



Tag Information
Tag Classit.eng.spago.taglib.html.ImgTag
TagExtraInfo ClassNone
Body Contentempty
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
aliasfalsetruejava.lang.StringName of the alias to be used instead of the src attribute.
aliasRelatedfalsetruejava.lang.StringString to be appended to the alias attribute if present.
alignfalsetruejava.lang.String

Where the image is aligned to. Can be one of the following attributes:

  • left - left justify, wrapping text on right
  • right -right justify, wrapping test on left
  • top - aligns the image with the top of the text on the same row
  • middle - aligns the image's vertical center with the text base line
  • bottom - aligns the image with the bottom of the text's base line
  • texttop - aligns the image's top with that of the text font on the same line
  • absmiddle - aligns the image's vertical center with the absolute center of the text
  • absbottom - aligns the image with the absolute bottom of the text font on the same row
altfalsetruejava.lang.String

And alternative text to be displayed in browsers that don't support graphics. Also used often as type of context help over images.

altKeyfalsetruejava.lang.String

The message resources key of the alternate text for this element.

borderfalsetruejava.lang.String

The width of the border surrounding the image.

bundlefalsetruejava.lang.String

The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

heightfalsetruejava.lang.String

The height of the image being displayed. This parameter is very nice to specify (along with width) to help the browser render the page faster.

hspacefalsetruejava.lang.String

The amount of horizontal spacing between the icon and the text. The text may be in the same paragraph, or be wrapped around the image.

imageNamefalsetruejava.lang.String

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

ismapfalsetruejava.lang.String

The name of the server-side map that this image belongs to.

localefalsetruejava.lang.String

The name of the request or session Locale attribute used to look up internationalized messages.

onclickfalsetruejava.lang.StringJavaScript event handler executed when this element receives a mouse click.
ondblclickfalsetruejava.lang.StringJavaScript event handler executed when this element receives a mouse double click.
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.StringJavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onmousemovefalsetruejava.lang.StringJavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onmouseoutfalsetruejava.lang.StringJavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onmouseoverfalsetruejava.lang.StringJavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onmouseupfalsetruejava.lang.StringJavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
paramIdfalsetruejava.lang.String

The name of the request parameter that will be dynamically added to the generated src URL. 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 service context data that is a String containing the value for the request parameter named by paramId. The data is constrained to the 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, containing the query parameters to be added to the hyperlink. The list must be formed of SourceBean with a name and value attributes.

scopefalsetruejava.lang.String

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

srcfalsetruejava.lang.String

The URL to which this image will be transferred from This image may be dynamically modified by the inclusion of query parameters, as described in the tag description. This value will be used unmodified (other than potential URL rewriting) as the value of the "src" attribute in the rendered tag.

srcKeyfalsetruejava.lang.String

The message key, in the message resources bundle named by the bundle attribute, of the String to be used as the URL of this image.

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).
titlefalsetruejava.lang.String

The advisory title for this element.

titleKeyfalsetruejava.lang.String

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

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.

usemapfalsetruejava.lang.String

The name of the map as defined within this page for mapping hot-spot areas of this image.

vspacefalsetruejava.lang.String

The amount of vertical spacing between the icon and the text, above and below.

widthfalsetruejava.lang.String

The width of the image being displayed. This parameter is very nice to specify (along with height) to help the browser render the page faster.


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.