html


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 it.eng.spago.action.EXCEPTION.

Tag Library Information
Display NameNone
Version1.3
Short Namehtml
URINone
 

Tag Summary
base

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).

button

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.

cancel

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.

checkbox

Render A Checkbox Input Field

Renders an HTML <input> element of type checkbox, populated from the specified value or the specified property searched on the service context. 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.

errors

Conditionally display a set of accumulated error messages.

Displays a set of error messages prepared by a business logic component and stored in EMFErrorHandler object as an EMFAbstractError. If EMFErrorHandler.isOk() return is true nothing will be rendered. Optionally a category and/or severity attributes can be provided; in this case only error messages with specified category and/or severity will be rendered. See EMFErrorCategory and EMFErrorSeverity for correct values for corresponding attributes.

In order to use this tag successfully, you must have defined an application scope bundle, with optional definitions of message keys specified in the following attributes:

  • header - Text that will be rendered before the error messages list. Typically, this message text will end with <ul> to start the error messages list (default "errors.header").
  • footer - Text that will be rendered after the error messages list. Typically, this message text will begin with </ul> to end the error messages list (default "errors.footer").
  • prefix - Text that will be rendered before each individual error in the list (default "errors.prefix").
  • suffix - Text that will be rendered after each individual error in the list (default "errors.suffix").
file

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 it.eng.spago.upload.FormFile property to null in the reset() method.

form

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 data to populate the input fields with the current property values.

frame

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 correspond to the href attribute passed.

There are two ways you can append one or more dynamically defined query parameters to the hyperlink -- specify a single parameter with the paramId attribute (and its associated attributes to select the value), or specify the property attribute to select a SourceBean List that contains one or more elements with the name and value attributes. These elements will be used to create the query string.

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

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

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

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

hidden

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.

html

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.

image

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 alias attributes, or indirectly by looking up a message resource string based on the srcKey attribute. 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.

img

Render an HTML img tag

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

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

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

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

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

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

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

link

Render an HTML anchor or hyperlink

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

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

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

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

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

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

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

option

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 service context data matches the specified value, this option will be marked selected. This tag is only valid when nested inside a <html:select> tag body.

optionsCollection

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> elements.

This tag operates on a collection of SourceBeans, where each bean has a label named attribute and a value named attribute. The actual names of these SourceBean attributes can be configured using the label and value attributes of this tag.

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.

password

Render A Password Input Field

Renders an HTML <input> element of type password, populated from the specified value or the specified property associated with our service context. This tag is only valid when nested inside a form tag body.
radio

Render A Radio Button Input Field

Renders an HTML <input> element of type radio, populated from the specified property of the service context. 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.

reset

Render A Reset Button Input Field

Renders an HTML <input> element of type reset.
rewrite

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.

select

Render A Select Element

Renders an HTML <select> element, associated with a 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:

  • multiple="true" IS NOT selected - The corresponding property should be a scalar value of any supported data type.
  • multiple="true" IS selected - The corresponding property should be an array of any supported data type.
submit

Render A Submit Button

Renders an HTML <input> element of type submit.

If a graphical button is needed (a button with an image), then the image tag is more appropriate.

text

Render An Input Field of Type text

Render an input field of type text. This tag is only valid when nested inside a form tag body.

textarea

Render A Textarea

Render a textarea element. This tag is only valid when nested inside a form tag body.
snippletRender the content of an external resource retrived with a HttpService instance.
 


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