Tag library reference for the following tag libraries:
This tag library contains tags useful in accessing beans and their properties, as well as defining new beans (based on these accesses) that are accessible to the remainder of the page via scripting variables and page scope attributes. Convenient mechanisms to create new beans based on the value of request cookies, headers, and parameters are also provided.Many of the tags in this tag library will throw a JspException at runtime when they are utilized incorrectly (such as when you specify an invalid combination of tag attributes). JSP allows you to declare an "error page" in the <%@ page %> directive. If you wish to process the actual exception that caused the problem, it is passed to the error page as a request attribute under key org.apache.struts.action.EXCEPTION.If you are viewing this page from within the Struts Documentation Application (or online at http://struts.apache.org), you can learn more about using these tags in the Bean Tags Developer's Guide.
This is version 1.3.
Required attributes are marked with a *
Load the response from a dynamic application request and make it available as a bean.
Perform an internal dispatch to the specified application component (or external URL) and make the response data from that request available as a scoped variable of type String. This tag has a function similar to that of the standard <jsp:include> tag, except that the response data is stored in a page scope attribute instead of being written to the output stream. If the current request is part of a session, the generated request for the include will also include the session identifier (and thus be part of the same session).
The URL used to access the specified application component is calculated based on which of the following attributes you specify (you must specify exactly one of them):
Can contain: empty
Name | Description | Type |
---|---|---|
anchor |
Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character. |
String |
forward |
Logical name of a global ActionForward that contains the actual content-relative URI of the resource to be included. |
String |
href |
Absolute URL (including the appropriate protocol prefix such as "http:") of the resource to be included. Because this URL could be external to the current web application, the session identifier will not be included in the request. |
String |
id* |
Specifies the name of the scripting variable (and associated page scope attribute) that will be made available with the value of the specified web application resource. |
String |
page |
Module-relative URI (starting with a '/') of the web application resource to be included. |
String |
transaction |
Set to true if you want the current transaction control token included in the generated URL for this include. |
String |
Render an internationalized message string to the response.
Retrieves an internationalized message for the specified locale, using the specified message key, and write it to the output stream. Up to five parametric replacements (such as "{0}") may be specified.
The message key may be specified directly, using the key attribute, or indirectly, using the name and property attributes to obtain it from a bean.
JSTL: The equivalent JSTL tag is <fmt:message>. For example, <fmt:message key="my.msg.key"> <fmt:param value="replacement text"/> </fmt:message>
Can contain: empty
Name | Description | Type |
---|---|---|
arg0 |
First parametric replacement value, if any. |
String |
arg1 |
Second parametric replacement value, if any. |
String |
arg2 |
Third parametric replacement value, if any. |
String |
arg3 |
Fourth parametric replacement value, if any. |
String |
arg4 |
Fifth parametric replacement value, if any. |
String |
bundle |
The name of the application scope bean under which the MessageResources object containing our messages is stored. |
String |
key |
The message key of the requested message, which must have a corresponding value in the message resources. If not specified, the key is obtained from the name and property attributes. |
String |
locale |
The name of the session scope bean under which our currently selected Locale object is stored. |
String |
name |
Specifies the attribute name of the bean whose property is accessed to retrieve the value specified by property (if specified). If property is not specified, the value of this bean itself will be used as the message resource key. |
String |
property |
Specifies the name of the property to be accessed on the bean specified by name. This value may be a simple, indexed, or nested property reference expression. If not specified, the value of the bean identified by name will itself be used as the message resource key. |
String |
scope |
Specifies the variable scope searched to retrieve the bean specified by name. If not specified, the default rules applied by PageContext.findAttribute() are applied. |
String |
Expose a specified item from the page context as a bean.
Retrieve the value of the specified item from the page context for this page, and define it as a scripting variable, and a page scope attribute accessible to the remainder of the current page.
If a problem occurs while retrieving the specified configuration object, a request time exception will be thrown.
Can contain: empty
Name | Description | Type |
---|---|---|
id* |
Specifies the name of the scripting variable (and associated page scope attribute) that will be made available with the value of the specified page context property. |
String |
property* |
Name of the property from our page context to be retrieved and exposed. Must be one of application, config, request, response, or session. |
String |
Load a web application resource and make it available as a bean.
Retrieve the value of the specified web application resource, and make it available as either a InputStream or a String, depending on the value of the input attribute.
If a problem occurs while retrieving the specified resource, a request time exception will be thrown.
Can contain: empty
Name | Description | Type |
---|---|---|
id* |
Specifies the name of the scripting variable (and associated page scope attribute) that will be made available with the value of the specified web application resource. |
String |
input |
If any arbitrary value for this attribute is specified, the resource will be made available as an InputStream. If this attribute is not specified, the resource will be made available as a String. |
String |
name* |
Module-relative name (starting with a '/') of the web application resource to be loaded and made available. |
String |
Define a bean containing the number of elements in a Collection or Map.
Given a reference to an array, Collection or Map, creates a new bean, of type java.lang.Integer, whose value is the number of elements in that collection. You can specify the collection to be counted in any one of the following ways:
Can contain: empty
Name | Description | Type |
---|---|---|
collection |
A runtime expression that evaluates to an array, a Collection, or a Map. |
String |
id* |
The name of a page scope JSP bean, of type java.lang.Integer, that will be created to contain the size of the underlying collection being counted. |
String |
name |
The name of the JSP bean (optionally constrained to the scope specified by the scope attribute) that contains the collection to be counted (if property is not specified), or whose property getter is called to return the collection to be counted (if property is specified. |
String |
property |
The name of the property, of the bean specified by the name attribute, whose getter method will return the collection to be counted. |
String |
scope |
The bean scope within which to search for the JSP bean specified by the name attribute. If not specified, the available scopes are searched in ascending sequence. |
String |
Expose a named Struts internal configuration object as a bean.
Retrieve the value of the specified Struts internal configuration object, and define it as a scripting variable and as a page scope attribute accessible to the remainder of the current page. You must specify exactly one of the formBean, forward, and mapping attributes to select the configuration object to be exposed.
If a problem occurs while retrieving the specified configuration object, a request time exception will be thrown.
Can contain: empty
Name | Description | Type |
---|---|---|
formBean |
Specifies the name of the Struts ActionFormBean definition object to be exposed. |
String |
forward |
Specifies the name of the global Struts ActionForward definition object to be exposed. |
String |
id* |
Specifies the name of the scripting variable (and associated page scope attribute) that will be made available with the value of the specified Struts internal configuration object. |
String |
mapping |
Specifies the matching path of the Struts ActionMapping definition object to be exposed. |
String |
This taglib contains tags used to create struts input forms, as well as other tags generally useful in the creation of HTML-based user interfaces. Many of the tags in this tag library will throw a JspException at runtime when they are utilized incorrectly (such as when you specify an invalid combination of tag attributes). JSP allows you to declare an "error page" in the <%@ page %> directive. If you wish to process the actual exception that caused the problem, it is passed to the error page as a request attribute under key org.apache.struts.action.EXCEPTION.
This is version 1.3.
Required attributes are marked with a *
Render an HTML <base> Element
Renders an HTML <base> element with an href attribute pointing to the absolute location of the enclosing JSP page. This tag is valid only when nested inside an HTML <head> element.
This tag is useful because it allows you to use relative URL references in the page that are calculated based on the URL of the page itself, rather than the URL to which the most recent submit took place (which is where the browser would normally resolve relative references against).
Can contain: empty
Name | Description | Type |
---|---|---|
ref |
The reference from which the base uri will created. Possible values are:
|
String |
server |
The server name to use instead of request.getServerName(). |
String |
target |
The window target for this base reference. |
String |
Render A Button Input Field
Renders an HTML <input> element of type button, populated from the specified value or the content of this tag body. This tag is only valid when nested inside a form tag body.
If a graphical button is needed (a button with an image), then the image tag is more appropriate.
Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property* | Name of the request parameter that will be included with this submission, set to the specified value. | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any), or "Click"] | String |
Render a Cancel Button
Renders an HTML <input> element of type submit. This tag is only valid when nested inside a form tag body. Pressing of this submit button causes the action servlet to bypass calling the associated form bean validate() method. The action is called normally.
Can contain:
Name | Description | Type |
---|---|---|
accesskey |
The keyboard character used to move focus immediately to this element. |
String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled |
Set to true |
String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property | Name of the request parameter that will be included with this submission, set to the specified value. WARNING NOT Action.isCancelled() | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any), or "Cancel"] | String |
Render A Checkbox Input Field
Renders an HTML <input> element of type checkbox, populated from the specified value or the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.
NOTE: The underlying property value associated with this field should be of type boolean, and any value you specify should correspond to one of the Strings that indicate a true value ("true", "yes", or "on"). If you wish to utilize a set of related String values, consider using the multibox tag.
WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method.
Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled |
Set to true |
String |
errorKey |
Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag. Since: Struts 1.2.5 |
String |
errorStyle |
CSS styles to be applied to this HTML element if an error exists for it. N.B. If present, this overrides the style attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleClass |
CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute). N.B. If present, this overrides the styleClass attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleId |
Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute). N.B. If present, this overrides the styleId attribute in the event of an error. Since: Struts 1.2.5 |
String |
indexed | Valid only inside of logic:iterate true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property* | Name of the request parameter that will be included with this submission, set to the specified value. | String |
style |
CSS styles to be applied to this HTML element. N.B. If present, the errorStyle overrides this attribute in the event of an error for the element. |
String |
styleClass |
CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element. |
String |
styleId |
Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. |
String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | The value to be transmitted if this checkbox is checked when the form is submitted. If not specified, the value "on" will be returned. | String |
Conditionally display a set of accumulated error messages.
Displays a set of error messages prepared by a business logic component and stored as an ActionErrors object, a String, or a String array in any scope. If such a bean is not found, nothing will be rendered.
In order to use this tag successfully, you must have defined an application scope MessageResources bean under the default attribute name, with optional definitions of message keys specified in the following attributes:
Can contain: empty
Name | Description | Type |
---|---|---|
bundle | The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet. | String |
footer | This value is an optional message resource key that will be printed after the iteration of error messages has finished. Defaults to "errors.footer" if not specified. Since: Struts 1.2.5 | String |
header | This value is an optional message resource key that will be printed before the iteration of error messages begins. Defaults to "errors.header" if not specified. Since: Struts 1.2.5 | String |
locale | The session attribute key for the Locale used to select messages to be displayed. If not specified, defaults to the Struts standard value. | String |
name | Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY | String |
prefix | This value is an optional message resource key that will be printed before an error message. Defaults to "errors.prefix" if not specified. Since: Struts 1.2.5 | String |
property | Name of the property for which error messages should be displayed. If not specified, all error messages (regardless of property) are displayed. | String |
suffix | This value is an optional message resource key that will be printed after an error message. Defaults to "errors.suffix" if not specified. Since: Struts 1.2.5 | String |
Render A File Select Input Field
Renders an HTML <input> element of type file, defaulting to the specified value or the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.
As with the corresponding HTML <input> element, the enclosing form element must specify "POST" for the method attribute, and "multipart/form-data" for the enctype attribute. For example:
<html:form method="POST" enctype="multipart/form-data"> <html:file property="theFile" /> </html:form>
WARNING: In order to correctly recognize uploaded files, the ActionForm bean associated with this form must include a statement setting the corresponding org.apache.struts.upload.FormFile property to null in the reset() method.
Can contain:
Name | Description | Type |
---|---|---|
accept | Comma-delimited set of content types that the server you submit to knows how to process. This list can be used by the client browser to limit the set of file options that is made available for selection. If not specified, no content type list will be sent. | String |
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
errorKey |
Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag. Since: Struts 1.2.5 |
String |
errorStyle |
CSS styles to be applied to this HTML element if an error exists for it. N.B. If present, this overrides the style attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleClass |
CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute). N.B. If present, this overrides the styleClass attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleId |
Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute). N.B. If present, this overrides the styleId attribute in the event of an error. Since: Struts 1.2.5 |
String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
maxlength | Maximum number of input characters to accept. This is ignored by most browsers. [No limit] | String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property* | Name of the request parameter that will be included with this submission, set to the specified value. | String |
size | Size of the file selection box to be displayed. | String |
style |
CSS styles to be applied to this HTML element. N.B. If present, the errorStyle overrides this attribute in the event of an error for the element. |
String |
styleClass |
CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element. |
String |
styleId |
Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. |
String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value |
Value to which this field should be initialized. [Use the corresponding bean property value or body content (if any) if property is not specified] NOTE: When setting this to some value, whether intentional or as the result (for example) of validation errors forcing the user back to the original jsp, this value is ignored by most browsers (for security reasons). This means that your users will have to re-select any previously selected files when submitting the form. Opera web browser will prompt the user so they have a chance to abort the submit. |
String |
Define An Input Form
Renders an HTML <form> element whose contents are described by the body content of this tag. The form implicitly interacts with the specified request scope or session scope bean to populate the input fields with the current property values from the bean.
The form bean is located, and created if necessary, based on the form bean specification for the associated ActionMapping.
Can contain: JSP
Name | Description | Type |
---|---|---|
acceptCharset | The list of character encodings for input data that the server should accept. Since: Struts 1.2.2 | String |
action |
The URL to which this form will be submitted. This value is also used to select the ActionMapping we are assumed to be processing, from which we can identify the appropriate form bean and scope. If a value is not provided, the original URI (servletPath) for the request is used. If you are using extension mapping for selecting the controller servlet, this value should be equal to the path attribute of the corresponding <action> element, optionally followed by the correct extension suffix. If you are using path mapping to select the controller servlet, this value should be exactly equal to the path attribute of the corresponding <action> element. |
String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true if the Form's input fields should be read only. Since: Struts 1.2.7 | String |
enctype | The content encoding to be used to submit this form, if the method is POST. This must be set to "multipart/form-data" if you are using the file tag to enable file upload. If not specified, the browser default (normally "application/x-www-form-urlencoded") is used. | String |
focus | The field name (among the fields on this form) to which initial focus will be assigned with a JavaScript function. If not specified, no special JavaScript for this purpose will be rendered. | String |
focusIndex | If the focus field is a field array, such as a radio button group, you can specify the index in the array to receive focus. Since: Struts 1.1 | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
method | The HTTP method that will be used to submit this request (GET, POST). [POST] | String |
onreset | JavaScript event handler executed if the form is reset. | String |
onsubmit | JavaScript event handler executed if the form is submitted. | String |
readonly | Set to true if this input field should be read only. Since: Struts 1.2.7 | String |
scriptLanguage | The form's focus <script> element will not contain a language attribute when this is set to false. The default is true but this property is ignored in XHMTL mode. Since: Struts 1.2 | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
target | Window target to which this form is submitted, such as for use in framed presentations. | String |
Render an HTML frame element
Renders an HTML <frame> element with processing for the src attribute that is identical to that performed by the <html:link> tag for the href attribute. URL rewriting will be applied automatically, to maintain session state in the absence of cookies.
The base URL for this frame is calculated based on which of the following attributes you specify (you must specify exactly one of them):
Normally, the hyperlink you specify with one of the attributes described in the previous paragraph 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 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:
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:
As the Map is processed, the keys are assumed to be the names of query parameters to be appended to the hyperlink. 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.
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 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.
Can contain: JSP
Name | Description | Type |
---|---|---|
action |
Logical name of a global Action that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. Additionally, you can specify a module prefix for linking to other modules. |
String |
anchor |
Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character. |
String |
bundle | The 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 | String |
forward |
Logical name of a global ActionForward that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. |
String |
frameName |
Value for the name attribute of the rendered <frame> element. |
String |
frameborder |
Should a frame border be generated around this frame (1) or not (0)? |
String |
href |
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 exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. |
String |
longdesc |
URI of a long description of the frame. This description should supplement the short description provided by the title attribute, and may be particularly useful for non-visual user agents. |
String |
marginheight |
The amount of space (in pixels) to be left between the frame's contents and its top and bottom margins. |
String |
marginwidth |
The amount of space (in pixels) to be left between the frame's contents and its left and right margins. |
String |
module |
Prefix name of a Module that contains the action mapping for the Action that is specified by the action attribute. You must specify an action attribute for this to have an effect. Note: Use "" to map to the default module. |
String |
name |
The name of a JSP bean that contains a Map representing the query parameters (if property is not specified), or a JSP bean whose property getter is called to return a Map (if property is specified). |
String |
noresize |
Should users be disallowed from resizing the frame? (true, false). |
String |
page |
The module-relative path (beginning with a "/" character) 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 exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. |
String |
paramId |
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 |
String |
paramName |
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. |
String |
paramProperty |
The name of a property of the bean specified by the paramName attribute, whose return value must be a String containing the value of the request parameter (named by the paramId attribute) that will be dynamically added to this hyperlink. |
String |
paramScope |
The scope within which to search for the bean specified by the paramName attribute. If not specified, all scopes are searched. |
String |
property |
The name of a property of the bean specified by the name attribute, whose return value must be a java.util.Map containing the query parameters to be added to the hyperlink. You must specify the name attribute if you specify this attribute. |
String |
scope |
The scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched. |
String |
scrolling |
Should scroll bars be created unconditionally (yes), never (no), or only when needed (auto)? |
String |
style |
CSS styles to be applied to this element. |
String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
transaction |
If set to true, any current transaction control token will be included in the generated hyperlink, so that it will pass an isTokenValid() test in the receiving Action. |
String |
Render A Hidden Field
Renders an HTML <input> element of type hidden, populated from the specified value or the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.
Can contain: empty
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property* | Name of this input field, and the name of the corresponding bean property if value is not specified. The corresponding bean property (if any) must be of type String. | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | Value to which this field should be initialized. [Use the corresponding bean property value] | String |
write | Should the value of this field also be rendered to the response page to make it visible, in addition to creating an HTML type="hidden" element? By default, only the hidden element is created. | String |
Render an HTML <html> Element
Renders an HTML <html> element with language attributes extracted from the user's current Locale object, if there is one.
Can contain: JSP
Name | Description | Type |
---|---|---|
lang | Renders a lang attribute with the locale stored in the user's session. If not found in the session, the language from the Accept-Language Since: Struts 1.2 | String |
xhtml |
Set to true in order to render xml:lang and xmlns attributes on the generated html element. This also causes all other html tags to render as XHTML 1.0 (the <html:xhtml/> tag has a similar purpose). Since: Struts 1.1 |
String |
Render an input tag of type "image"
Renders an HTML <input> tag of type "image". The base URL for this image is calculated directly based on the value specified in the src or page attributes, or indirectly by looking up a message resource string based on the srcKey or pageKey attributes. You must specify exactly one of these attributes.
If you would like to obtain the coordinates of the mouse click that submitted this request, see the information below on the property attribute.
This tag is only valid when nested inside a form tag body.
Can contain:
Name | Description | Type |
---|---|---|
accesskey |
The keyboard character used to move focus immediately to this element. |
String |
align |
The alignment option for this image. |
String |
alt |
The alternate text for this image. |
String |
altKey |
The message resources key of the alternate text for this image. |
String |
border |
The width (in pixels) of the border around this image. |
String |
bundle |
The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet. |
String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
locale |
The session attribute key for the Locale used to select internationalized messages. If not specified, defaults to the Struts standard value. |
String |
module |
Prefix name of a Module that the page or pageKey attributes relate to. |
String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
page |
The module-relative path of the image for this input tag. |
String |
pageKey |
The key of the message resources string specifying the module-relative path of the image for this input tag. |
String |
property |
The property name of this image tag. The parameter names for the request will appear as "property.x" and "property.y", the x and y representing the coordinates of the mouse click for the image. A way of retrieving these values through a form bean is to define getX(), getY(), setX(), and setY() methods, and specify your property as a blank string (property=""). |
String |
src |
The source URL of the image for this input tag. |
String |
srcKey |
The key of the message resources string specifying the source URL of the image for this input tag. |
String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value |
The value that will be submitted if this image button is pressed. |
String |
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:
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:
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.
Can contain: empty
Name | Description | Type |
---|---|---|
action |
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 action attribute on the link tag works), in addition to any necessary URL rewriting. You must specify the action, page attribute or the src attribute. Additionally, you can specify a module prefix for linking to other modules. |
String |
align |
Where the image is aligned to. Can be one of the following attributes:
|
String |
alt |
And alternative text to be displayed in browsers that don't support graphics. Also used often as type of context help over images. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
border |
The width of the border surrounding the image. |
String |
bundle |
The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet. |
String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
height |
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. |
String |
hspace |
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. |
String |
imageName |
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. |
String |
ismap |
The name of the server-side map that this image belongs to. |
String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
locale |
The name of the request or session Locale attribute used to look up internationalized messages. |
String |
module |
Prefix name of a Module that contains the action mapping for the Action that is specified by the action attribute. You must specify an action attribute for this to have an effect. Note: Use "" to map to the default module. |
String |
name |
The name of a JSP bean that contains a Map representing the query parameters (if property is not specified), or a JSP bean whose property getter is called to return a Map (if property is specified). |
String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onkeydown |
JavaScript event handler that is executed when this element receives a key down event. |
String |
onkeypress |
JavaScript event handler that is executed when this element receives a key press event. |
String |
onkeyup |
JavaScript event handler that is executed when this element receives a key up event. |
String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
page |
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 page attribute on the link tag works), in addition to any necessary URL rewriting. You must specify either the page attribute or the src attribute. |
String |
pageKey |
The message key, in the message resources bundle named by the bundle attribute, of the String to be used as the module-relative path for this image. |
String |
paramId |
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 |
String |
paramName |
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. |
String |
paramProperty |
The name of a property of the bean specified by the paramName attribute, whose return value must be a String containing the value of the request parameter (named by the paramId attribute) that will be dynamically added to this src URL. |
String |
paramScope |
The scope within which to search for the bean specified by the paramName attribute. If not specified, all scopes are searched. |
String |
property |
The name of a property of the bean specified by the name attribute, whose return value must be a java.util.Map containing the query parameters to be added to the src URL. You must specify the name attribute if you specify this attribute. |
String |
scope |
The scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched. |
String |
src |
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 page attribute or the src attribute. |
String |
srcKey |
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. |
String |
style |
CSS styles to be applied to this element. |
String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
useLocalEncoding |
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. |
String |
usemap |
The name of the map as defined within this page for mapping hot-spot areas of this image. |
String |
vspace |
The amount of vertical spacing between the icon and the text, above and below. |
String |
width |
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. |
String |
Render JavaScript validation based on the validation rules loaded by the ValidatorPlugIn.
Render JavaScript validation based on the validation rules loaded by the ValidatorPlugIn. The set of validation rules that should be generated is based on the formName attribute passed in, which should match the name attribute of the form element in the xml file.
The dynamicJavascript and staticJavascript attributes default to true, but if dynamicJavascript is set to true and staticJavascript is set to false then only the dynamic JavaScript will be rendered. If dynamicJavascript is set to false and staticJavascript is set to true then only the static JavaScript will be rendered which can then be put in separate JSP page so the browser can cache the static JavaScript.
Can contain: empty
Name | Description | Type |
---|---|---|
bundle | The 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.7 | String |
cdata |
If set to "true" and XHTML has been enabled, the JavaScript will be wrapped in a CDATA section to prevent XML parsing. The default is "true" to comply with the W3C's recommendation. Since: Struts 1.1 |
String |
dynamicJavascript |
Whether or not to render the dynamic JavaScript. Defaults to true. |
String |
formName |
The key (form name) to retrieve a specific set of validation rules. If "dynamicJavascript" is set to true and formName is missing or is not recognized by the ValidatorPlugIn, a JspException will be thrown. |
String |
htmlComment |
Whether or not to enclose the javascript with HTML comments. This attribute is ignored in XHTML mode because the script would be deleted by the XML parser. See the cdata attribute for details on hiding scripts from XML parsers. Defaults to true. |
String |
method |
The alternate JavaScript method name to be used instead of the of the default. The default is 'validate' concatenated in front of the key (form name) passed in (ex: validateRegistrationForm). |
String |
page |
The current page of a set of validation rules if the page attribute for the field element in the xml file is in use. |
String |
scriptLanguage |
The <script> element will not contain a language attribute when this is set to false. The default is true but this property is ignored in XHTML mode. Since: Struts 1.2 |
String |
src |
The src attribute's value when defining the html script element. |
String |
staticJavascript |
Whether or not to render the static JavaScript. Defaults to true. |
String |
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 calculated based on which of the following attributes you specify (you must specify exactly one of them):
Normally, the hyperlink you specify with one of the attributes described in the previous paragraph 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 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:
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:
As the Map is processed, the keys are assumed to be the names of query parameters to be appended to the hyperlink. 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.
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 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.
Can contain: JSP
Name | Description | Type |
---|---|---|
accesskey |
The keyboard character used to move focus immediately to this element. |
String |
action |
Logical name of a Action that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the action attribute, the forward attribute, the href attribute, the linkName attribute, or the page attribute. Additionally, you can specify a module prefix for linking to other modules. |
String |
anchor |
Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
forward |
Logical name of a global ActionForward that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the action attribute, the forward attribute, the href attribute, the linkName attribute, or the page attribute. |
String |
href |
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 exactly one of the action attribute, the forward attribute, the href attribute, the linkName attribute, or the page attribute. |
String |
indexId | By this attribute different name for the indexed parameter can be specified. Take a look to the "indexed" attribute for details. | String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
linkName |
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. |
String |
module |
Prefix name of a Module that contains the action mapping for the Action that is specified by the action attribute. You must specify an action attribute for this to have an effect. Note: Use "" to map to the default module. |
String |
name |
The name of a JSP bean that contains a Map representing the query parameters (if property is not specified), or a JSP bean whose property getter is called to return a Map (if property is specified). |
String |
onblur |
JavaScript event handler that is executed when this element loses input focus. |
String |
onclick |
JavaScript event handler that is executed when this element receives a mouse click. |
String |
ondblclick |
JavaScript event handler that is executed when this element receives a mouse double click. |
String |
onfocus |
JavaScript event handler that is executed when this element receives input focus. |
String |
onkeydown |
JavaScript event handler that is executed when this element receives a key down event. |
String |
onkeypress |
JavaScript event handler that is executed when this element receives a key press event. |
String |
onkeyup |
JavaScript event handler that is executed when this element receives a key up event. |
String |
onmousedown |
JavaScript event handler that is executed when this element receives a mouse down event. |
String |
onmousemove |
JavaScript event handler that is executed when this element receives a mouse move event. |
String |
onmouseout |
JavaScript event handler that is executed when this element receives a mouse out event. |
String |
onmouseover |
JavaScript event handler that is executed when this element receives a mouse over event. |
String |
onmouseup |
JavaScript event handler that is executed when this element receives a mouse up event. |
String |
page |
The module-relative path (beginning with a "/" character) 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 exactly one of the action attribute, forward attribute, the href attribute, the linkName attribute, or the page attribute. |
String |
paramId |
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 |
String |
paramName |
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. |
String |
paramProperty |
The name of a property of the bean specified by the paramName attribute, whose return value must be a String containing the value of the request parameter (named by the paramId attribute) that will be dynamically added to this hyperlink. |
String |
paramScope |
The scope within which to search for the bean specified by the paramName attribute. If not specified, all scopes are searched. |
String |
property |
The name of a property of the bean specified by the name attribute, whose return value must be a java.util.Map containing the query parameters to be added to the hyperlink. You must specify the name attribute if you specify this attribute. |
String |
scope |
The scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched. |
String |
style |
CSS styles to be applied to this element. |
String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
tabindex |
The tab order (ascending positive integers) for this element. |
String |
target |
The window target in which the resource requested by this hyperlink will be displayed, for example in a framed presentation. |
String |
title |
The advisory title for this hyperlink. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
transaction |
If set to true, any current transaction control token will be included in the generated hyperlink, so that it will pass an isTokenValid() test in the receiving Action. |
String |
useLocalEncoding |
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. |
String |
Conditionally display a set of accumulated messages.
Displays a set of messages prepared by a business logic component and stored as an ActionMessages object, ActionErrors object, a String, or a String array in any scope. If such a bean is not found, nothing will be rendered.
In order to use this tag successfully, you must have defined an application scope MessageResources bean under the default attribute name.
Can contain: JSP
Name | Description | Type |
---|---|---|
bundle | The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet. | String |
footer | This value is an optional message resource key that will be printed after the iteration of messages has finished. | String |
header | This value is an optional message resource key that will be printed before the iteration of messages begins. | String |
id* | The name of a page scope JSP bean that will contain the current element of the collection of messages on each iteration, if it is not null | String |
locale | The session attribute key for the Locale used to select messages to be displayed. If not specified, defaults to the Struts standard value. | String |
message | By default the tag will retrieve the bean it will iterate over from the Globals.ERROR_KEY Globals.MESSAGE_KEY | String |
name | Name of the bean in any scope under which our messages have been stored. If not present, the name specified by the Globals.ERROR_KEY | String |
property | Name of the property for which messages should be displayed. If not specified, all messages (regardless of property) are displayed. | String |
Render A Checkbox Input Field
Renders an HTML <input> element of type checkbox, whose "checked" status is initialized based on whether the specified value matches one of the elements of the underlying property's array of current values. This element is useful when you have large numbers of checkboxes, and prefer to combine the values into a single array-valued property instead of multiple boolean properties. This tag is only valid when nested inside a form tag body.
WARNING: In order to correctly recognize cases where none of the associated checkboxes are selected, the ActionForm bean associated with this form must include a statement setting the corresponding array to zero length in the reset() method.
The value to be returned to the server, if this checkbox is selected, must be defined by one of the following methods:
Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
disabled | Set to true | String |
errorKey |
Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag. Since: Struts 1.2.5 |
String |
errorStyle |
CSS styles to be applied to this HTML element if an error exists for it. N.B. If present, this overrides the style attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleClass |
CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute). N.B. If present, this overrides the styleClass attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleId |
Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute). N.B. If present, this overrides the styleId attribute in the event of an error. Since: Struts 1.2.5 |
String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property* | Name of the request parameter that will be included with this submission, set to the specified value. | String |
style |
CSS styles to be applied to this HTML element. N.B. If present, the errorStyle overrides this attribute in the event of an error for the element. |
String |
styleClass |
CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element. |
String |
styleId |
Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. |
String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | The value to be transmitted if this checkbox is checked when the form is submitted. | String |
Render A Select Option
Render an HTML <option> element, representing one of the choices for an enclosing <select> element. The text displayed to the user comes from either the body of this tag, or from a message string looked up based on the bundle, locale, and key attributes.
If the value of the corresponding bean property matches the specified value, this option will be marked selected. This tag is only valid when nested inside a <html:select> tag body.
Can contain:
Name | Description | Type |
---|---|---|
bundle | The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet. | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
filter | Set to true if you want the option label to be filtered for sensitive characters in HTML. By default, such a value is NOT filtered. | String |
key | If specified, defines the message key to be looked up in the resource bundle specified by bundle | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
locale | The session attributes key for the Locale instance to use for looking up the message specified by the key | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
value* | Value to be submitted for this field if this option is selected by the user. | String |
Render a Collection of Select Options
Renders a set of HTML <option> elements, representing possible choices for a <select> element. This tag can be used multiple times within a single <html:select> element, either in conjunction with or instead of one or more <html:option> or <html:optionsCollection> elements.
This tag operates in one of two major modes, depending on whether or not the collection attribute is specified. If the collection attribute is included, the following rules apply:
If the collection attribute is not specified, the rules described in the remainder of this section apply.
The collection of values actually selected depends on the presence or absence of the name and property attributes. The following combinations are allowed:
The collection of labels displayed to the user can be the same as the option values themselves, or can be different, depending on the presence or absence of the labelName and labelProperty attributes. If this feature is used, the collection of labels must contain the same number of elements as the corresponding collection of values. The following combinations are allowed:
Note that this tag does not support a styleId attribute, as it would have to apply the value to all the option elements created by this element, which would mean that more than one id element might have the same value, which the HTML specification says is illegal.
Can contain: empty
Name | Description | Type |
---|---|---|
collection | Name of the JSP bean (in some scope) which is itself a Collection of other beans, each of which has properties named by the "property" and "labelProperty" attributes that are used to retrieve the value and label for each option, respectively. | String |
filter | Set to false | String |
labelName | Name of the JSP bean (in some scope) containing the collection of labels to be displayed to the user for these options. | String |
labelProperty | Property of the form bean, or the bean specified by the labelName attribute, that will return the collection of labels to be displayed to the user for these options. | String |
name | Name of the JSP bean (in some scope) containing the collection of values to be returned to the server for these options. If not specified, the form bean associated with our form is assumed. | String |
property | Property of the form bean, or the bean specified by the name attribute, that will return the collection of values to returned to the server for these options. | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
Render a Collection of Select Options
Renders a set of HTML <option> elements, representing possible choices for a <select> element. This tag can be used multiple times within a single <html:select> element, either in conjunction with or instead of one or more <html:option> or <html:options> elements.
This tag operates on a collection of beans, where each bean has a label property and a value property. The actual names of these properties can be configured using the label and value attributes of this tag.
This tag differs from the <html:options> tag in that it makes more consistent use of the name and property attributes, and allows the collection to be more easily obtained from the enclosing form bean.
Note that this tag does not support a styleId attribute, as it would have to apply the value to all the option elements created by this element, which would mean that more than one id element might have the same value, which the HTML specification says is illegal.
Can contain: empty
Name | Description | Type |
---|---|---|
filter | Set to false | String |
label | The property of the bean within the collection which represents the label to be rendered for each option. Defaults to "label". | String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
property | The property of the form bean, or the bean specified by the name attribute, that will return the collection of objects to be rendered for these options. | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
value | The property of the bean within the collection which represents the value to be rendered for each option. Defaults to "value". | String |
Adds a parameter to the following tags:
Can contain:
Name | Description | Type |
---|---|---|
name* |
The String containing the name of the request parameter. |
String |
value |
The value of the request parameter specified by the name attribute, whose return value must be a String or String[] that will be dynamically added to this hyperlink. |
String |
Render A Password Input Field
Renders an HTML <input> element of type password, populated from the specified value or the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
errorKey |
Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag. Since: Struts 1.2.5 |
String |
errorStyle |
CSS styles to be applied to this HTML element if an error exists for it. N.B. If present, this overrides the style attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleClass |
CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute). N.B. If present, this overrides the styleClass attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleId |
Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute). N.B. If present, this overrides the styleId attribute in the event of an error. Since: Struts 1.2.5 |
String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
maxlength | Maximum number of input characters to accept. [No limit] | String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
onselect | JavaScript event handler executed when a when a user selects some text in a text field. Since: Struts 1.3.10 | String |
property* | Name of the request parameter that will be included with this submission, set to the specified value. | String |
readonly | Set to true if this input field should be read only. | String |
redisplay | Boolean flag indicating whether or not existing values will be redisplayed if they exist. Even though the redisplayed value will be shown as asterisks on the visible HTML page, the cleartext of the actual password value will be visible though the "Show Page Source" menu option of the client browser. You may wish to set this value to false true | String |
size | Number of character positions to allocate. [Browser default] | String |
style |
CSS styles to be applied to this HTML element. N.B. If present, the errorStyle overrides this attribute in the event of an error for the element. |
String |
styleClass |
CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element. |
String |
styleId |
Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. |
String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any)] | String |
Render A Radio Button Input Field
Renders an HTML <input> element of type radio, populated from the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.
If an iterator is used to render a series of radio tags, the idName attribute may be used to specify the name of the bean exposed by the iterator. In this case, the value attribute is used as the name of a property on the idName bean that returns the value of the radio tag in this iteration.
Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
errorKey |
Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag. Since: Struts 1.2.5 |
String |
errorStyle |
CSS styles to be applied to this HTML element if an error exists for it. N.B. If present, this overrides the style attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleClass |
CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute). N.B. If present, this overrides the styleClass attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleId |
Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute). N.B. If present, this overrides the styleId attribute in the event of an error. Since: Struts 1.2.5 |
String |
idName |
Name of the bean (in some scope) that will return the value of the radio tag. Usually exposed by an iterator. When the idName attribute is present, the value attribute is used as the name of the property on the idName bean that will return the value of the radio tag for this iteration. Since: Struts 1.1 |
String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property* | The corresponding bean property for this radio tag. | String |
style |
CSS styles to be applied to this HTML element. N.B. If present, the errorStyle overrides this attribute in the event of an error for the element. |
String |
styleClass |
CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element. |
String |
styleId |
Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. |
String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value* | The value of the radio tag. | String |
Render A Reset Button Input Field
Renders an HTML <input> element of type reset.Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property | Name of the input field that will be generated. | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | Value of the label to be placed on this button. [Body of this tag (if any), or "Reset"] | String |
Render an URI
Renders a request URI based on exactly the same rules as the link tag does, but without creating the <a> hyperlink. This value is useful when you want to generate a string constant for use by a JavaScript procedure.
Can contain: JSP
Name | Description | Type |
---|---|---|
action |
Logical name of a Action that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. Additionally, you can specify a module prefix for linking to other modules. Since: Struts 1.2.0 |
String |
anchor |
Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character. |
String |
forward |
Logical name of a global ActionForward that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. |
String |
href |
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 exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. |
String |
module |
Prefix name of a Module that contains the action mapping for the Action that is specified by the action attribute. You must specify an action attribute for this to have an effect. Note: Use "" to map to the default module. |
String |
name |
The name of a JSP bean that contains a Map representing the query parameters (if property is not specified), or a JSP bean whose property getter is called to return a Map (if property is specified). |
String |
page |
The module-relative path (beginning with a "/" character) 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 exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. |
String |
paramId |
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 |
String |
paramName |
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. |
String |
paramProperty |
The name of a property of the bean specified by the paramName attribute, whose return value must be a String containing the value of the request parameter (named by the paramId attribute) that will be dynamically added to this hyperlink. |
String |
paramScope |
The scope within which to search for the bean specified by the paramName attribute. If not specified, all scopes are searched. |
String |
property |
The name of a property of the bean specified by the name attribute, whose return value must be a java.util.Map containing the query parameters to be added to the hyperlink. You must specify the name attribute if you specify this attribute. |
String |
scope |
The scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched. |
String |
transaction |
If set to true, any current transaction control token will be included in the generated hyperlink, so that it will pass an isTokenValid() test in the receiving Action. |
String |
useLocalEncoding |
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. |
String |
Render A Select Element
Renders an HTML <select> element, associated with a bean property specified by our attributes. This tag is only valid when nested inside a form tag body.
This tag operates in two modes, depending upon the state of the multiple attribute, which affects the data type of the associated property you should use:
WARNING: In order to correctly recognize cases where no selection at all is made, the ActionForm bean associated with this form must include a statement resetting the scalar property to a default value (if multiple is not set), or the array property to zero length (if multiple is set) in the reset() method.
Can contain: JSP
Name | Description | Type |
---|---|---|
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
errorKey |
Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag. Since: Struts 1.2.5 |
String |
errorStyle |
CSS styles to be applied to this HTML element if an error exists for it. N.B. If present, this overrides the style attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleClass |
CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute). N.B. If present, this overrides the styleClass attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleId |
Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute). N.B. If present, this overrides the styleId attribute in the event of an error. Since: Struts 1.2.5 |
String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
multiple | If set to any arbitrary value, the rendered select element will support multiple selections. | String |
name | The attribute name of the bean whose properties are consulted to determine which option should be pre-selected when rendering this input field. If not specified, the bean associated with the enclosing <html:form> | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property* | Name of the request parameter that will be included with this submission, set to the specified value. | String |
size | The number of available options displayed at one time. | String |
style |
CSS styles to be applied to this HTML element. N.B. If present, the errorStyle overrides this attribute in the event of an error for the element. |
String |
styleClass |
CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element. |
String |
styleId |
Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. |
String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | The value to compare with for marking an option selected. | String |
Render A Submit Button
Renders an HTML <input> element of type submitIf a graphical button is needed (a button with an image), then the image tag is more appropriate.
Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
property | Name of the request parameter that will be included with this submission, set to the specified value. | String |
style | CSS styles to be applied to this HTML element. | String |
styleClass | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). | String |
styleId | Identifier to be assigned to this HTML element (renders an "id" attribute). | String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | The value of the button label. | String |
Render An Input Field of Type text
Render an input button of type text. This tag is only valid when nested inside a form tag body.Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
errorKey |
Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag. Since: Struts 1.2.5 |
String |
errorStyle |
CSS styles to be applied to this HTML element if an error exists for it. N.B. If present, this overrides the style attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleClass |
CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute). N.B. If present, this overrides the styleClass attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleId |
Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute). N.B. If present, this overrides the styleId attribute in the event of an error. Since: Struts 1.2.5 |
String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
maxlength | Maximum number of input characters to accept. [No limit] | String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
onselect | JavaScript event handler executed when a when a user selects some text in a text field. | String |
property* | Name of this input field, and the name of the corresponding bean property if value is not specified. The corresponding bean property (if any) must be of type String. | String |
readonly | Set to true if this input field should be read only. | String |
size | Number of character positions to allocate. [Browser default] | String |
style |
CSS styles to be applied to this HTML element. N.B. If present, the errorStyle overrides this attribute in the event of an error for the element. |
String |
styleClass |
CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element. |
String |
styleId |
Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. |
String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | Value to which this field should be initialized. [Use the corresponding bean property value] | String |
Render A Textarea
Render a textarea element. This tag is only valid when nested inside a form tag body.Can contain:
Name | Description | Type |
---|---|---|
accesskey | The keyboard character used to move focus immediately to this element. | String |
alt |
The alternate text for this element. |
String |
altKey |
The message resources key of the alternate text for this element. |
String |
bundle | The 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 | String |
cols | The number of columns to display. | String |
dir |
The direction for weak/neutral text for this element. Since: Struts 1.3.6 |
String |
disabled | Set to true | String |
errorKey |
Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag. Since: Struts 1.2.5 |
String |
errorStyle |
CSS styles to be applied to this HTML element if an error exists for it. N.B. If present, this overrides the style attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleClass |
CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute). N.B. If present, this overrides the styleClass attribute in the event of an error. Since: Struts 1.2.5 |
String |
errorStyleId |
Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute). N.B. If present, this overrides the styleId attribute in the event of an error. Since: Struts 1.2.5 |
String |
indexed | Valid only inside of logic-el:iterate c:forEach true | String |
lang |
The language code for this element. Since: Struts 1.3.6 |
String |
name | The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. | String |
onblur | JavaScript event handler executed when this element loses input focus. | String |
onchange | JavaScript event handler executed when this element loses input focus and its value has changed. | String |
onclick | JavaScript event handler executed when this element receives a mouse click. | String |
ondblclick | JavaScript event handler executed when this element receives a mouse double click. | String |
onfocus | JavaScript event handler executed when this element receives input focus. | String |
onkeydown | JavaScript event handler executed when this element has focus and a key is depressed. | String |
onkeypress | JavaScript event handler executed when this element has focus and a key is depressed and released. | String |
onkeyup | JavaScript event handler executed when this element has focus and a key is released. | String |
onmousedown | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. | String |
onmousemove | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. | String |
onmouseout | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. | String |
onmouseover | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. | String |
onmouseup | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. | String |
onselect | JavaScript event handler executed when a when a user selects some text in a text field. | String |
property* | Name of this input field, and the name of the corresponding bean property if value is not specified. The corresponding bean property (if any) must be of type String. | String |
readonly | Set to true if this input field should be read only. | String |
rows | The number of rows to display. | String |
style |
CSS styles to be applied to this HTML element. N.B. If present, the errorStyle overrides this attribute in the event of an error for the element. |
String |
styleClass |
CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element. |
String |
styleId |
Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. |
String |
tabindex | The tab order (ascending positive integers) for this element. | String |
title |
The advisory title for this element. |
String |
titleKey |
The message resources key for the advisory title for this element. |
String |
value | Value to which this field should be initialized. [Use the corresponding bean property value] | String |
Render HTML tags as XHTML
Using this tag in a page tells all other html taglib tags to render themselves as XHTML 1.0. This is useful when composing pages with JSP includes or Tiles. <html:html xhtml="true"> has a similar effect. This tag has no attributes; you use it like this: <html:xhtml/>.
Note: Included pages do not inherit the rendering style of the including page. Each JSP fragment or Tile must use this tag to render as XHTML.
Can contain: empty
This tag has no attributes.
This tag library contains tags that are useful in managing conditional generation of output text, looping over object collections for repetitive generation of output text, and application flow management.
For tags that do value comparisons (equal, greaterEqual, greaterThan, lessEqual, lessThan, notEqual), the following rules apply:
For tags that do substring matching (match, notMatch), the following rules apply:
Many of the tags in this tag library will throw a JspException at runtime when they are utilized incorrectly (such as when you specify an invalid combination of tag attributes). JSP allows you to declare an "error page" in the <%@ page %> directive. If you wish to process the actual exception that caused the problem, it is passed to the error page as a request attribute under key org.apache.struts.action.EXCEPTION.
Struts-logic tags NOT implemented.
This library, a derivation of the normal "struts-logic" library, provides the functionality of the Struts logic tags, but assumes the presence of the JavaServer Pages Standard Library (JSTL), and uses the JSTL expression engine (hereafter abbreviated in many places as just "el") to evaluate attribute values instead of using JSP runtime expressions (sometimes called "rtexprvalues").
Because it is assumed this library will be used with the JSTL and the new EL engine, there are some tags in the struts-logic library which provide functionality which is entirely subsumed by the JSTL. This section lists each struts-logic tag which is NOT implemented in the struts-logic-el library, and describes the JSTL tag which can be used instead of the Struts tag.Struts-Logic TagJSTL Tag
<logic:empty>
This functionality is subsumed by the JSTL <c:if>, <c:when> tags and the empty function in the JSTL EL.
Example: <c:if test="${empty var}">CONTENT</c:if>
This is version 1.3.
Required attributes are marked with a *
Forward control to the page specified by the specified ActionForward entry.
Performs a PageContext.forward() or HttpServletResponse.sendRedirect() call for the global ActionForward entry for the specified name. URL rewriting will occur automatically if a redirect is performed.
Can contain: empty
Name | Description | Type |
---|---|---|
name* |
The logical name of the global ActionForward entry that identifies the destination, and forwarding approach, to be used. Note: forwarding to Tiles definitions is not supported from this tag. You should forward to them from an Action subclass. |
String |
Repeat the nested body content of this tag over a specified collection.
Repeats the nested body content of this tag once for every element of the specified collection, which must be an Iterator, a Collection, a Map (whose values are to be iterated over), or an array. The collection to be iterated over must be specified in one of the following ways:
The collection to be iterated over MUST conform to one of the following requirements in order for iteration to be successful:
Normally, each object exposed by the iterate tag is an element of the underlying collection you are iterating over. However, if you iterate over a Map, the exposed object is of type Map.Entry that has two properties:
So, if you wish to iterate over the values of a Hashtable, you would implement code like the following:
<logic-el:iterate id="element" name="myhashtable"> Next element is <bean:write name="element" property="value"/> </logic-el:iterate>If the collection you are iterating over can contain null values, the loop will still be performed but no page scope attribute (named by the id attribute) will be created for that loop iteration. You can use the <logic-el:present;gt; and <logic-el:notPresent> tags to test for this case.
Can contain: JSP
Name | Description | Type |
---|---|---|
collection |
A runtime expression that evaluates to a collection (conforming to the requirements listed above) to be iterated over. |
String |
id* |
The name of a page scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. |
String |
indexId |
The name of a page scope JSP bean that will contain the current index of the collection on each iteration. |
String |
length |
The maximum number of entries (from the underlying collection) to be iterated through on this page. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, there will be no limit on the number of iterations performed. |
String |
name |
The name of the JSP bean containing the collection to be iterated (if property is not specified), or the JSP bean whose property getter returns the collection to be iterated (if property is specified). |
String |
offset |
The zero-relative index of the starting point at which entries from the underlying collection will be iterated through. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integer that defines the desired value. If not present, zero is assumed (meaning that the collection will be iterated from the beginning. |
String |
property |
Name of the property, of the JSP bean specified by name, whose getter returns the collection to be iterated. |
String |
scope |
The bean scope within which to search for the bean named by the name property, or "any scope" if not specified. |
String |
type |
Fully qualified Java class name of the element to be exposed through the JSP bean named from the id attribute. If not present, no type conversions will be performed. NOTE: The actual elements of the collection must be assignment-compatible with this class, or a request time ClassCastException will occur. |
String |
Evaluate the nested body content of this tag if the specified value is an appropriate substring of the requested variable.
Matches the variable specified by one of the selector attributes (as a String) against the specified constant value. If the value is a substring (appropriately limited by the location attribute), the nested body content of this tag is evaluated.
Can contain: JSP
Name | Description | Type |
---|---|---|
cookie |
The variable to be matched is the value of the cookie whose name is specified by this attribute. |
String |
expr |
A specific value to be compared with, either a static value, or an EL value. |
String |
header |
The variable to be matched is the value of the header whose name is specified by this attribute. The name match is performed in a case insensitive manner. |
String |
location |
If not specified, a match between the variable and the value may occur at any position within the variable string. If specified, the match must occur at the specified location (either start or end) of the variable string. |
String |
name |
The variable to be matched is the JSP bean specified by this attribute, if property is not specified, or the value of the specified property of this bean, if property is specified. |
String |
parameter |
The variable to be matched is the first, or only, value of the request parameter specified by this attribute. |
String |
property |
The variable to be matched is the property (of the bean specified by the name attribute) specified by this attribute. The property reference can be simple, nested, and/or indexed. |
String |
scope |
The bean scope within which to search for the bean named by the name property, or "any scope" if not specified. |
String |
value* |
The constant value which is checked for existence as a substring of the specified variable. |
String |
Generate the nested body content of this tag if the specified message is not present in this request.
Evaluates the nested body content of this tag if an ActionMessages object, ActionErrors object, a String, or a String array is not in request scope. If such a bean is not found, nothing will be rendered.
Since: Struts 1.1Can contain: JSP
Name | Description | Type |
---|---|---|
message |
By default the tag will retrieve the request scope bean it will iterate over from the Action.ERROR_KEY constant string, but if this attribute is set to 'true' the request scope bean will be retrieved from the Action.MESSAGE_KEY constant string. Also if this is set to 'true', any value assigned to the name attribute will be ignored. |
String |
name |
The parameter key to retrieve the message from request scope. |
String |
property |
Name of the property for which messages should be retrieved. If not specified, all messages (regardless of property) are retrieved. |
String |
Generate the nested body content of this tag if the specified message is present in this request.
Evaluates the nested body content of this tag if an ActionMessages object, ActionErrors object, a String, or a String array is in request scope. If such a bean is not found, nothing will be rendered.
Since: Struts 1.1Can contain: JSP
Name | Description | Type |
---|---|---|
message |
By default the tag will retrieve the request scope bean it will iterate over from the Action.ERROR_KEY constant string, but if this attribute is set to 'true' the request scope bean will be retrieved from the Action.MESSAGE_KEY constant string. Also if this is set to 'true', any value assigned to the name attribute will be ignored. |
String |
name |
The parameter key to retrieve the message from request scope. |
String |
property |
Name of the property for which messages should be retrieved. If not specified, all messages (regardless of property) are retrieved. |
String |
Evaluate the nested body content of this tag if the specified value is not an appropriate substring of the requested variable.
Matches the variable specified by one of the selector attributes (as a String) against the specified constant value. If the value is not a substring (appropriately limited by the location attribute), the nested body content of this tag is evaluated.
Can contain: JSP
Name | Description | Type |
---|---|---|
cookie |
The variable to be matched is the value of the cookie whose name is specified by this attribute. |
String |
expr |
A specific value to be compared with, either a static value, or an EL value. |
String |
header |
The variable to be matched is the value of the header whose name is specified by this attribute. The name match is performed in a case insensitive manner. |
String |
location |
If not specified, a match between the variable and the value may occur at any position within the variable string. If specified, the match must occur at the specified location (either start or end) of the variable string. |
String |
name |
The variable to be matched is the JSP bean specified by this attribute, if property is not specified, or the value of the specified property of this bean, if property is specified. |
String |
parameter |
The variable to be matched is the first, or only, value of the request parameter specified by this attribute. |
String |
property |
The variable to be matched is the property (of the bean specified by the name attribute) specified by this attribute. The property reference can be simple, nested, and/or indexed. |
String |
scope |
The bean scope within which to search for the bean named by the name property, or "any scope" if not specified. |
String |
value* |
The constant value which is checked for existence as a substring of the specified variable. |
String |
Generate the nested body content of this tag if the specified value is not present in this request.
Depending on which attribute is specified, this tag checks the current request, and evaluates the nested body content of this tag only if the specified value is not present. Only one of the attributes may be used in one occurrence of this tag, unless you use the property attribute, in which case the name attribute is also required.
Can contain: JSP
Name | Description | Type |
---|---|---|
cookie |
Checks for the existence of a cookie with the specified name. |
String |
header |
Checks for the existence of an HTTP header with the specified name. The name match is performed in a case insensitive manner. |
String |
name |
Checks for the existence of a JSP bean, in any scope, with the specified name. If property is also specified, checks for a non-null property value for the specified property. |
String |
parameter |
Checks for the existence of at least one occurrence of the specified request parameter on this request, even if the parameter value is a zero-length string. |
String |
property |
Checks for the existence of a non-null property value, returned by a property getter method on the JSP bean (in any scope) that is specified by the name attribute. Property references can be simple, nested, and/or indexed. |
String |
role |
Checks whether the currently authenticated user (if any) has been associated with the specified security role. |
String |
scope |
The bean scope within which to search for the bean named by the name property, or "any scope" if not specified. |
String |
user |
Checks whether the currently authenticated user principal has the specified name. |
String |
Generate the nested body content of this tag if the specified value is present in this request.
Depending on which attribute is specified, this tag checks the current request, and evaluates the nested body content of this tag only if the specified value is present. Only one of the attributes may be used in one occurrence of this tag, unless you use the property attribute, in which case the name attribute is also required.
Can contain: JSP
Name | Description | Type |
---|---|---|
cookie |
Checks for the existence of a cookie with the specified name. |
String |
header |
Checks for the existence of an HTTP header with the specified name. The name match is performed in a case insensitive manner. |
String |
name |
Checks for the existence of a JSP bean, in any scope, with the specified name. If property is also specified, checks for a non-null property value for the specified property. |
String |
parameter |
Checks for the existence of at least one occurrence of the specified request parameter on this request, even if the parameter value is a zero-length string. |
String |
property |
Checks for the existence of a non-null property value, returned by a property getter method on the JSP bean (in any scope) that is specified by the name attribute. Property references can be simple, nested, and/or indexed. |
String |
role |
Checks whether the currently authenticated user (if any) has been associated with any of the specified security roles. Use a comma-delimited list to check for multiple roles. Example: <logic-el:present role="role1,role2,role3"> code..... </logic-el:present> |
String |
scope |
The bean scope within which to search for the bean named by the name property, or "any scope" if not specified. |
String |
user |
Checks whether the currently authenticated user principal has the specified name. |
String |
Render an HTTP Redirect
Performs an HttpServletResponse.sendRedirect() call to the hyperlink specified by the attributes to this tag. URL rewriting will be applied automatically, to maintain session state in the absence of cookies.
The base URL for this redirect is calculated based on which of the following attributes you specify (you must specify exactly one of them):
Normally, the redirect you specify with one of the attributes described in the previous paragraph 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 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:
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:
As the Map is processed, the keys are assumed to be the names of query parameters to be appended to the hyperlink. The value associated with each key must be either a String or a String array representing the parameter value(s). If a String array is specified, more than one value for the same query parameter name will be created.
Can contain:
Name | Description | Type |
---|---|---|
action |
Logical name of a global Action that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the action attribute, the forward attribute, the href attribute, or the page attribute. |
String |
anchor |
Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character. |
String |
forward |
Logical name of a global ActionForward that contains the actual content-relative URI of the destination of this redirect. This URI may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the forward attribute, the href attribute, the linkName attribute, or the page attribute. |
String |
href |
The URL to which this redirect will transfer control. This URL may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the forward attribute, the href attribute, the linkName attribute, or the page attribute. |
String |
name |
The name of a JSP bean that contains a Map representing the query parameters (if property is not specified), or a JSP bean whose property getter is called to return a Map (if property is specified). |
String |
page |
The context-relative path (beginning with a "/" character) 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 exactly one of the forward attribute, the href attribute, the linkName attribute, or the page attribute. |
String |
paramId |
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 |
String |
paramName |
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. |
String |
paramProperty |
The name of a property of the bean specified by the paramName attribute, whose return value must be a String containing the value of the request parameter (named by the paramId attribute) that will be dynamically added to this hyperlink. |
String |
paramScope |
The scope within which to search for the bean specified by the paramName attribute. If not specified, all scopes are searched. |
String |
property |
The name of a property of the bean specified by the name attribute, whose return value must be a java.util.Map containing the query parameters to be added to the hyperlink. You must specify the name attribute if you specify this attribute. |
String |
scope |
The scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched. |
String |
transaction |
Set to true if you want the current transaction control token included in the generated URL for this redirect. |
String |
useLocalEncoding |
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. |
String |
This tag library provides tiles tags. Tiles were previously called Components. For historical reasons, names, pages, components and templates are used indifferently to design a tile. Also, a lot of tags and attribute names are left for backward compatibility. To know more about tags defined in this library, check the associated documentation: tiles-doc.
This is version 1.3.
Required attributes are marked with a *
Add an element to the surrounding list. Equivalent to 'put', but for list element.
Add an element to the surrounding list. This tag can only be used inside putList tag. Value can come from a direct assignment (value="aValue") or from a bean. One of 'value' or 'beanName' must be present.
Can contain: JSP
Name | Description | Type |
---|---|---|
beanName |
Name of the bean used as value. Bean is retrieved from specified context, if any. Otherwise, method pageContext.findAttribute is used. If beanProperty is specified, retrieve value from the corresponding bean property. |
String |
beanProperty |
Bean property name. If specified, value is retrieved from this property. Supports nested/indexed properties. |
String |
beanScope |
Scope into which bean is searched. If not specified, method pageContext.findAttribute is used. Scope can be any JSP scope, 'component', or 'template'. In these two later cases, bean is search in tile/component/template context. |
String |
content |
Element value. Can be a String or Object. Synonym to value. Attribute added for compatibility with JSP Template. |
String |
direct |
Determines how content is handled: true means content is printed direct |
String |
role |
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped). The role isn't taken into account if <add> tag is used in a definition. |
String |
type |
Specify content type: string, page, template or instance.
|
String |
value |
Element value. Can be a String or Object. |
String |
Create a tile /component / template definition bean.
Create a tile/component/template definition as a bean. Newly created bean will be saved under specified "id", in the requested "scope". Definition tag has same syntax as insert
Can contain: JSP
Name | Description | Type |
---|---|---|
extends |
Name of a parent definition that is used to initialize this new definition. Parent definition is searched in definitions factory. |
String |
id* |
Specifies the name under which the newly created definition bean will be saved. |
String |
page |
URL of the template / component to insert. Same as "template". |
String |
role |
Role to check before inserting this definition. If role is not defined for current user, definition is not inserted. Checking is done at insert time, not during definition process. |
String |
scope |
Specifies the variable scope into which the newly defined bean will be created. If not specified, the bean will be created in page scope. |
String |
template |
A string representing the URI of a tile/component/template (a JSP page). |
String |
Gets the content from request scope that was put there by a put tag.
Retrieve content from tile context and include it.
Take into account the 'type' attribute.
Can contain: empty
Name | Description | Type |
---|---|---|
flush |
True or false. If true, current page out stream is flushed before insertion. |
String |
ignore |
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown. |
String |
name* |
The name of the content to get from tile/component scope. |
String |
role |
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped). |
String |
Render the value of the specified tile/component/template attribute to the current JspWriter
Retrieve the value of the specified tile/component/template attribute property, and render it to the current JspWriter as a String. The usual toString() conversions is applied on found value.
Throw a JSPException if named value is not found.
Can contain: empty
Name | Description | Type |
---|---|---|
ignore |
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown. |
String |
name* |
Attribute name. |
String |
role |
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped). |
String |
Import Tile's attribute in specified context.
Import attribute from tile to requested scope. Attribute name and scope are optional. If not specified, all tile attributes are imported in page scope. Once imported, an attribute can be used as any other beans from jsp contexts.
Can contain: empty
Name | Description | Type |
---|---|---|
ignore |
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without error. The default value is false, which will cause a runtime exception to be thrown. |
String |
name | Tile's attribute name. If not specified, all attributes are imported. | String |
scope |
Scope into which attribute is imported. Default to page. |
String |
Initialize Tile/Component definitions factory.
In order to use Tile/Component definitions factory, you need to initialize the factory. This is generally done in a initializing servlet. In particular, it is done in "ComponentActionServlet" if you use it. If you don't initialize factory in a servlet, you can initialize it using this tag. You need to provide the description file name, and optionally the factory classname. Initialization is done only once, at the first call of this tag. Subsequent calls are ignored (tag checks existence of the factory).
Can contain: empty
Name | Description | Type |
---|---|---|
classname |
If specified, classname of the factory to create and initialized. |
String |
file* |
Definition file name. |
String |
Insert a tiles/component/template.
Insert a tiles/component/template with the possibility to pass parameters (called attribute). A tile can be seen as a procedure that can take parameters or attributes. <tiles:insert> allows to define these attributes and pass them to the inserted jsp page, called template. Attributes are defined using nested tag <tiles:put> or <tiles:putList>.
You must specify one of this tag attribute :
In fact, Page, component and template, are equivalent as a tile, component or template are jsp page.
Example :
<tiles:insert page="/basic/myLayout.jsp" flush="true"> <tiles:put name="title" value="My first page" /> <tiles:put name="header" value="/common/header.jsp" /> <tiles:put name="footer" value="/common/footer.jsp" /> <tiles:put name="menu" value="/basic/menu.jsp" /> <tiles:put name="body" value="/basic/helloBody.jsp" /> </tiles:insert>
Can contain: JSP
Name | Description | Type |
---|---|---|
attribute |
Name of an attribute in current tile/component context. Value of this attribute is passed to 'name' (see attribute 'name'). |
String |
beanName |
Name of the bean used as value. Bean is retrieved from specified context, if any. Otherwise, method pageContext.findAttribute is used. If beanProperty is also specified, retrieve value from the corresponding bean property. If found bean (or property value) is instance of one of Attribute class (Direct, Instance, ...), insertion is done according to the class type. Otherwise, the toString method is called on the bean, and returned String is used as name to insert (see 'name' attribute). |
String |
beanProperty |
Bean property name. If specified, value is retrieved from this property. Supports nested/indexed properties. |
String |
beanScope |
Scope into which bean is searched. If not specified, method pageContext.findAttribute is used. Scope can be any JSP scope, 'component', or 'template'. In these two later cases, bean is search in tile/component/template context. |
String |
component |
Path (relative or absolute to webapps) of the component to insert. 'page', 'component' and 'template' are synonyms : they have exactly the same behavior. |
String |
controllerClass |
Class type of a controller called immediately before page is inserted. Controller is used to prepare data to be render by inserted Tile. See also controlerUrl Class must implements or extends one of the following :
See also controllerUrl. Only one of controllerUrl or controllerClass should be used. |
String |
controllerUrl |
Url of a controller called immediately before page is inserted. Url usually denote a Struts action. Controller (action) is used to prepare data to be render by inserted Tile. See also controlerClass. Only one of controllerUrl or controllerClass should be used. |
String |
definition |
Name of the definition to insert. Definition are defined in a centralized file. For now, only definition from factory can be inserted with this attribute. To insert a definition defined with tag <tiles:definition>, use beanName="". |
String |
flush |
True or false. If true, current page out stream is flushed before insertion. |
String |
ignore |
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown. |
String |
name |
Name of an entity to insert. Search is done in this order : definition, attribute, [tile/component/template/page]. |
String |
page |
Path (relative or absolute to webapps) of the page to insert. 'page', 'component' and 'template' are synonyms : they have exactly the same behavior. |
String |
role |
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped). |
String |
template |
A string representing the URI of a tile or template (a JSP page). 'page', 'component' and 'template' are synonyms : they have exactly the same behavior. |
String |
Put an attribute into tile/component/template context.
Define an attribute to pass to tile/component/template. This tag can only be used inside 'insert' or 'definition' tag. Value (or content) is specified using attribute 'value' (or 'content'), or using the tag body. It is also possible to specify the type of the value :
If 'type' attribute is not specified, content is 'untyped', unless it comes from a typed bean.
Note that using 'direct="true"' is equivalent to 'type="string"'.
Can contain: JSP
Name | Description | Type |
---|---|---|
beanName |
Name of the bean used as value. Bean is retrieved from specified context, if any. Otherwise, method pageContext.findAttribute is used. If beanProperty is specified, retrieve value from the corresponding bean property. |
String |
beanProperty |
Bean property name. If specified, value is retrieve from this property. Support nested/indexed properties. |
String |
beanScope |
Scope into which bean is searched. If not specified, method pageContext.findAttribute is used. Scope can be any JSP scope, 'tile', 'component', or 'template'. In these three later cases, bean is search in tile/component/template context. |
String |
content |
Content that's put into tile scope. Synonym to value. Attribute added for compatibility with JSP Template. |
String |
direct |
Determines how content is handled: true means content is printed direct |
String |
name |
Name of the attribute. |
String |
role |
If the user is in the specified role, the tag is taken into account; otherwise, the tag is ignored (skipped). |
String |
type |
Specify content type: string, page, template or definition.
|
String |
value |
Attribute value. Could be a String or an Object. Value can come from a direct assignment (value="aValue") or from a bean. One of 'value' 'content' or 'beanName' must be present. |
String |
Declare a list that will be pass as attribute to tile.
Declare a list that will be pass as attribute to tile. List elements are added using the tag 'add'. This tag can only be used inside 'insert' or 'definition' tag.
Can contain: JSP
Name | Description | Type |
---|---|---|
name* |
Name of the list. |
String |
Use attribute value inside page.
Declare a Java variable, and an attribute in the specified scope, using tile attribute value.
Java variable and attribute will have the name specified by 'id', or the original name if not specified.
Can contain: empty
Name | Description | Type |
---|---|---|
classname |
Class of the declared variable. |
String |
id |
Declared attribute and variable name. |
String |
ignore |
If this attribute is set to true, and the attribute specified by the name does not exist, simply return without error. The default value is false, which will cause a runtime exception to be thrown. |
String |
name* |
Tile's attribute name. |
String |
scope |
Scope of the declared attribute. Default to 'page'. |
String |