Tag reference sheet

Tag library reference for the following tag libraries:

Struts-Faces

<p>This tag library provides custom action functionality that is similar to that provided by the Struts 1.1 tag libraries, but is built on top of the JavaServer Faces rendering architecture.</p> <p>This tag library includes the following tags:</p>

This is version 1.3.

  • base Renders an HTML &lt;base&gt; element with an href attribute pointing to the absolute location of the enclosing JSP page
  • commandLink Renders an HTML &lt;a&gt; element defining a hyperlink that submits the current form
  • errors Displays a list of error messages prepared by form bean or business logic validation processing
  • form Render an HTML form element containing the nested components to present the appropriate label and input field elements
  • html Renders an HTML &lt;html&gt; element with language attributes extracted from the user's current Locale object, if there is one
  • javascript IMPLEMENTATION NOTE - Unlike other tags in this tag library, this does not correspond to a JavaServer Faces user interface component
  • loadMessages Create a Map wrapping the specified MessageResources instance, which will return localized messages based on the Locale stored in the view root component of the current view
  • message Render the message text looked up from a message resources bundle, based on our current locale
  • stylesheet Renders an HTML &lt;link&gt; element with a relative reference to a text/css stylesheet at the specified context-relative path
  • write Render the text associated with the specified model object or text string, optionally performing filtering and formatting tasks described by the optional attributes described below
Required attributes are marked with a *

<Struts-Faces:base>

<p>Renders an HTML <code>&lt;base&gt;</code> element with an <code>href</code> attribute pointing to the absolute location of the enclosing JSP page. This tag is valid only when nested inside an HTML <code>&lt;head&gt;</code> element. This tag is useful because it allows you to use relative URL references that are based on the URL of the page itself, rather than the URL to which the most recent submit took place.</p>

Can contain:

Attributes

NameDescriptionType
binding <p>Value binding expression to bind this component to a backing bean property.</p> String
id Component id of this component. String
rendered Boolean attribute indicating whether this component should be rendered or not. String
target Target frame for this base reference. String

<Struts-Faces:commandLink>

<p>Renders an HTML <code>&lt;a&gt;</code> element defining a hyperlink that submits the current form. This component is required because the JSF 1.0 and 1.1 specifications require interoperability between the renderers for the form element and the command link element, without providing a portable mechanism to allow intermixed libraries.</p>

Can contain:

Attributes

NameDescriptionType
accesskeyString
actionString
actionListenerString
charsetString
dirString
hreflangString
idString
immediateString
langString
onblurString
onclickString
ondblclickString
onfocusString
onkeydownString
onkeypressString
onkeyupString
onmousedownString
onmousemoveString
onmouseoutString
onmouseoverString
onmouseupString
relString
renderedString
revString
styleString
styleClassString
tabindexString
targetString
titleString
typeString
valueString

<Struts-Faces:errors>

<p>Displays a list of error messages prepared by form bean or business logic validation processing.</p> <p>In order to use this component successfully, you must have defined an application scope <code>MessageResources</code> bean under the specified attribute name, with optinal definitions for the following message keys:</p>

Can contain:

Attributes

NameDescriptionType
binding <p>Value binding expression to bind this component to a backing bean property.</p> String
bundle <p>Name of the servlet context attribute under which the desired <code>MessageResources</code> bundle is stored. If not specified, the default bundle for this sub-application will be used.</p> String
id Component id of this component. String
property Component of the component for which to render errors. If not specified, all messages (regardless of property) are displayed. String
rendered Boolean attribute indicating whether this component should be rendered or not. String

<Struts-Faces:form>

<p>Render an HTML form element containing the nested components to present the appropriate label and input field elements. This tag is distinguished from the tag in the standard HTML RenderKit because it accepts a Struts <code>&lt;action&gt;</code> path as a parameter, and triggers the creation of a Struts form bean if needed.</p>

Can contain:

Attributes

NameDescriptionType
action* <p>Struts <code>Action</code> to which this form should be submitted. This value must exactly match the <code>path</code> attribute of the corresponding <code>&lt;action&gt;</code> element in the <code>struts-config.xml</code> configuration file for this application module.</p> String
binding <p>Value binding expression to bind this component to a backing bean property.</p> String
enctype <p>The content encoding to be used to submit this form, if the method is <code>POST</code>. This must be set to "<code>multipart/form-data</code>" if your form includes file upload field(s). If not specified, the browser default ("<code>application/x-www-form-urlencoded</code>") is used.</p> String
focus <p>The identifier of the form field that should receive focus when this form is rendered.</p> String
focusIndex <p>If the focus field is an array, such as a radio button group, you can specify the index of the array element to receive focus.</p> String
id Component id of this component. String
onreset <p>JavaScript event handler executed if this form is reset.</p> String
onsubmit <p>JavaScript event handler executed if this form is submitted.</p> String
rendered Boolean attribute indicating whether this component should be rendered or not. String
style <p>CSS styles to be applied to this HTML element.</p> String
styleClass CSS style class to use when rendering this component. String
target <p>Window target to which this form is submitted, such as for use in framed presentations.</p> String

<Struts-Faces:html>

<p>Renders an HTML <code>&lt;html&gt;</code> element with language attributes extracted from the user's current Locale object, if there is one.</p>

Can contain: JSP

Attributes

NameDescriptionType
binding <p>Value binding expression to bind this component to a backing bean property.</p> String
id Component id of this component. String
locale <p>Set to <code>true</code> in order to record a <code>Locale</code> based on the current request's <code>Accept-Language</code> header (if any), if none has currently been set.</p> String
rendered Boolean attribute indicating whether this component should be rendered or not. String
xhtml <p>Set to <code>true</code> to render an <code>xml:lang</code> element on the generated <code>html</code> element. It also causes nested Struts HTML tags (although not JavaServer Faces component tags) to render themselves as xhtml.</p> String

<Struts-Faces:javascript>

<p> <strong>IMPLEMENTATION NOTE</strong> - Unlike other tags in this tag library, this does not correspond to a JavaServer Faces user interface component. It is based on the tag implementation class used in the <code>struts-html</code> tag library.</p> <p>Render JavaScript validation based on the validation rules loaded by the <code>ValidatorPlugIn</code>. 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.</p> <p>The dynamicJavascript and staticJavascript attributes default to true, but if dynamicJavascript is set to <code>true</code> and staticJavascript is set to <code>false</code> then only the dynamic JavaScript will be rendered. If dynamicJavascript is set to <code>false</code> and staticJavascript is set to <code>true</code> 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.</p>

Can contain:

Attributes

NameDescriptionType
cdata <p>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.</p> String
dynamicJavascript <p>Whether or not to render the dynamic JavaScript. Defaults to <code>true</code>.</p> String
formName <p>The key (form name) to retrieve a specific set of validation rules.</p> String
htmlComment <p>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 <code>true</code>.</p> String
method <p>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).</p> String
page <p>The current page of a set of validation rules if the page attribute for the field element in the xml file is in use.</p> String
src <p>The src attribute's value when defining the html script element.</p> String
staticJavascript <p>Whether or not to render the static JavaScript. Defaults to <code>true</code>.</p> String

<Struts-Faces:loadMessages>

<p>Create a Map wrapping the specified MessageResources instance, which will return localized messages based on the Locale stored in the view root component of the current view.</p>

Can contain: empty

Attributes

NameDescriptionType
messages <p>Application scope key containing the MessageResources instance to be exposed. If not specified, the default MessageResources instance for the current application module is exposed.</p> String
var* <p>Request scope key under which the Map will be stored.</p> String

<Struts-Faces:message>

<p>Render the message text looked up from a message resources bundle, based on our current locale. The message key must be specified by exactly one of the following attributes:</p> <p>The <code>MessageResources</code> bundle to be used is specified by the <code>bundle</code> attribute, as follows:</p> <p>Substitution parameters for the message may be nested inside this tag by using the <code>parameter</code> tag from the standard HTML RenderKit tag library.</p> <p>Additional control over the rendering process is specified by the following optional attributes, with default values as indicated:</p>

Can contain: JSP

Attributes

NameDescriptionType
binding <p>Value binding expression to bind this component to a backing bean property.</p> String
bundle <p>Name of the servlet context attribute under which the desired <code>MessageResources</code> bundle is stored. If not specified, the default bundle for this sub-application will be used.</p> String
filter <p>Should we filter the output for characters that are sensitive in HTML? The default value is <code>true</code>.</p> String
id <p>Component identifier of the component corresponding to this tag.</p> String
key <p>Literal value of the message key to look up. Exactly one of <code>key</code> and <code>value</code> must be specified. </p> String
rendered Boolean attribute indicating whether this component should be rendered or not. String
style <p>CSS styles used to render this component.</p> String
styleClass <p>Name of the CSS style class used to render this component.</p> String
value <p>Value reference expression used to retrieve a dynamic value for the message key to look up. Exactly one of <code>key</code> and <code>value</code> must be specified.</p> String

<Struts-Faces:stylesheet>

<p>Renders an HTML <code>&lt;link&gt;</code> element with a relative reference to a <code>text/css</code> stylesheet at the specified context-relative path.</p>

Can contain:

Attributes

NameDescriptionType
binding <p>Value binding expression to bind this component to a backing bean property.</p> String
id Component id of this component. String
path* Context-relative path to the resource for this relative link. String
rendered Boolean attribute indicating whether this component should be rendered or not. String

<Struts-Faces:write>

<p>Render the text associated with the specified model object or text string, optionally performing filtering and formatting tasks described by the optional attributes described below. The text to be rendered is specified in exactly one of the following attributes:</p> <p>Additional control over the rendering process is specified by the following optional attributes, with default values as indicated:</p>

Can contain: empty

Attributes

NameDescriptionType
binding <p>Value binding expression to bind this component to a backing bean property.</p> String
filter <p>Should we filter the output for characters that are sensitive in HTML? The default value is <code>true</code>.</p> String
id <p>Component identifier of the component corresponding to this tag.</p> String
rendered Boolean attribute indicating whether this component should be rendered or not. String
style <p>CSS styles used to render this component.</p> String
styleClass <p>Name of the CSS style class used to render this component.</p> String
value <p>Literal text to be rendered, or value reference expression to retrieve the text to be rendered.</p> String