| |||||||
FRAMES NO FRAMES |
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
, page
, or action
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
, page
, or action
or page
, or indirectly by looking up a message resource string based on the srcKey
or pageKey
attributes. You must specify exactly one of these attributes.
Normally, the src
, page
, or action
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 name
(and optional property
) attributes to select a java.util.Map
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, use one of the following approaches:
paramName
attribute - The named JSP bean (optionally scoped by the value of the paramScope
attribute) must identify a value that can be converted to a String.paramName
and paramProperty
attributes - The specified property getter will be called on the JSP bean identified by the paramName
(and optional paramScope
) attributes, in order to select a value that can be converted to a String.If you prefer to specify a java.util.Map
that contains all of the request parameters to be added to the hyperlink, use one of the following techniques:
name
attribute - The named JSP bean (optionally scoped by the value of the scope
attribute) must identify a java.util.Map
containing the parameters.name
and property
attributes - The specified property getter method will be called on the bean identified by the name
(and optional scope
) attributes, in order to return the java.util.Map
containing the parameters.As the Map
is processed, the keys are assumed to be the names of query parameters to be appended to the src
URL. The value associated with each key must be either a String or a String array representing the parameter value(s), or an object whose toString() method will be called. If a String array is specified, more than one value for the same query parameter name will be created.
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 Class | org.apache.struts.taglib.html.ImgTag |
TagExtraInfo Class | None |
Body Content | empty |
Display Name | None |
Attributes | ||||
Name | Required | Request-time | Type | Description |
align | false | true | java.lang.String | Where the image is aligned to. Can be one of the following attributes:
|
alt | false | true | java.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. |
altKey | false | true | java.lang.String | The message resources key of the alternate text for this element. |
border | false | true | java.lang.String | The width of the border surrounding the image. |
bundle | false | true | java.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. |
dir | false | true | java.lang.String | The direction for weak/neutral text for this element.
|
height | false | true | java.lang.String | The height of the image being displayed. This parameter is very nice to specify (along with |
hspace | false | true | java.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. |
imageName | false | true | java.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. |
ismap | false | true | java.lang.String | The name of the server-side map that this image belongs to. |
lang | false | true | java.lang.String | The language code for this element.
|
locale | false | true | java.lang.String | The name of the request or session Locale attribute used to look up internationalized messages. |
name | false | true | java.lang.String | The name of a JSP bean that contains a |
onclick | false | true | java.lang.String | JavaScript event handler executed when this element receives a mouse click. |
ondblclick | false | true | java.lang.String | JavaScript event handler executed when this element receives a mouse double click. |
onkeydown | false | true | java.lang.String | JavaScript event handler that is executed when this element receives a key down event. |
onkeypress | false | true | java.lang.String | JavaScript event handler that is executed when this element receives a key press event. |
onkeyup | false | true | java.lang.String | JavaScript event handler that is executed when this element receives a key up event. |
onmousedown | false | true | java.lang.String | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. |
onmousemove | false | true | java.lang.String | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. |
onmouseout | false | true | java.lang.String | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. |
onmouseover | false | true | java.lang.String | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. |
onmouseup | false | true | java.lang.String | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. |
paramId | false | true | java.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 |
page | false | true | java.lang.String | The module-relative path, starting with a slash, of the image to be displayed by this tag. The rendered URL for this image will automatically prepend the context path of this web application (in the same manner as the |
pageKey | false | true | java.lang.String | The message key, in the message resources bundle named by the |
action | false | true | java.lang.String | The action, starting with a slash, that will render the image to be displayed by this tag. The rendered URL for this image will automatically prepend the context path of this web application (in the same manner as the Additionally, you can specify a |
module | false | true | java.lang.String | Prefix name of a Note: Use "" to map to the default module. |
paramName | false | true | java.lang.String | The name of a JSP bean that is a String containing the value for the request parameter named by |
paramProperty | false | true | java.lang.String | The name of a property of the bean specified by the |
paramScope | false | true | java.lang.String | The scope within which to search for the bean specified by the |
property | false | true | java.lang.String | The name of a property of the bean specified by the |
scope | false | true | java.lang.String | The scope within which to search for the bean specified by the |
src | false | true | java.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. You must specify either the |
srcKey | false | true | java.lang.String | The message key, in the message resources bundle named by the |
style | false | true | java.lang.String | CSS styles to be applied to this element. |
styleClass | false | true | java.lang.String | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). |
styleId | false | true | java.lang.String | Identifier to be assigned to this HTML element (renders an "id" attribute). |
title | false | true | java.lang.String | The advisory title for this element. |
titleKey | false | true | java.lang.String | The message resources key for the advisory title for this element. |
useLocalEncoding | false | true | boolean | If set to |
usemap | false | true | java.lang.String | The name of the map as defined within this page for mapping hot-spot areas of this image. |
vspace | false | true | java.lang.String | The amount of vertical spacing between the icon and the text, above and below. |
width | false | true | java.lang.String | The width of the image being displayed. This parameter is very nice to specify (along with |
Variables | No Variables Defined. |
| |||||||
FRAMES NO FRAMES |