Tag javascript

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.

Tag Information
Tag Classorg.apache.struts.taglib.html.JavascriptValidatorTag
TagExtraInfo ClassNone
Body Contentempty
Display NameNone


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.

Struts 1.1

Whether or not to render the dynamic JavaScript. Defaults to true.


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.


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


The current page of a set of validation rules if the page attribute for the field element in the xml file is in use.

scriptLanguagefalsetruebooleanThe <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.
Struts 1.2

The src attribute's value when defining the html script element.


Whether or not to render the static JavaScript. Defaults to true.


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.

bundlefalsetruejava.lang.StringThe servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.
Struts 1.2.7

No Variables Defined.

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