[ http://issues.apache.org/struts/browse/STR-2712?page=all ] David Evans resolved STR-2712: ------------------------------
Resolution: Fixed > Warnings on generating validator's static javascript > ---------------------------------------------------- > > Key: STR-2712 > URL: http://issues.apache.org/struts/browse/STR-2712 > Project: Struts Action 1 > Type: Bug > Components: Taglibs > Versions: 1.2.8 > Environment: Operating System: other > Platform: Other > Reporter: Dmitrii CRETU > > Configuration > ============= > * struts-1.2.8 > * commons-validator-1.2.0 (NOT 1.1.4 coming by default with struts-1.2.8) > > * put static (common) JavaScript into a single jsp : > > ------------------------------------------------------------------------ > <html:javascript dynamicJavascript="false" staticJavascript="true" /> > > ------------------------------------------------------------------------ > Issue > ===== > After migrating to configuration described above we permanently get the > following log message while running our applications : > -------------------------------------------------------------------------------- > Dec 30, 2005 12:15:56 PM org.apache.commons.validator.ValidatorResources > getForm > WARNING: Form 'null' not found for locale 'en_US' > -------------------------------------------------------------------------------- > Cause > ===== > * JavascriptValidatorTag.renderJavascript() calls > ValidatorResources.getForm(...) even when dynamicJavascript=false > * Since 1.2.0 ValidatorResources.getForm(...) method posts this warning > if > no form is found for given formKey, null in our case > Solution proposed > ================= > Not to call getForm() when dynamicJavascript=false (we don't need form's > validation rules in this case - as far as I can see). > In class org.apache.struts.taglib.html.JavascriptValidatorTag ($Rev: 331265 > $) > from line 380 : > -------------------------------------------------------------------------------- > 380,388c380,391 > < Form form = resources.getForm(locale, formName); > < > < if ("true".equalsIgnoreCase(dynamicJavascript) && form == null) > < { > < throw new JspException("No form found under '" > < + formName > < + "' in locale '" > < + locale > < + "'"); > --- > > Form form = null; > > > > // we only need form's resources when generating dynamic javascript > > if ("true".equalsIgnoreCase(dynamicJavascript)) { > > form = resources.getForm(locale, formName); > > if (form == null) { > > throw new JspException("No form found under '" > > + formName > > + "' in locale '" > > + locale > > + "'"); > > } > 389a393 > > > -------------------------------------------------------------------------------- > Note > ==== > Maybe it's a good idea to put in JavascriptValidatorTag a validation like > this : > (dynamicJavascript==false && formName==null) > || (dynamicJavascript==true && formName!=null) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]