You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ni...@apache.org on 2006/02/11 22:32:42 UTC

svn commit: r377060 - /struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java

Author: niallp
Date: Sat Feb 11 13:32:41 2006
New Revision: 377060

URL: http://svn.apache.org/viewcvs?rev=377060&view=rev
Log:
Fix for Bug 38081 - Warnings on generating validator's static javascript - patch supplied by Dmitrii CRETU

Modified:
    struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java

Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java?rev=377060&r1=377059&r2=377060&view=diff
==============================================================================
--- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java (original)
+++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java Sat Feb 11 13:32:41 2006
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,8 +53,7 @@
  * the validation rules loaded by the <code>ValidatorPlugIn</code> defined in
  * the struts-config.xml file.
  *
- * @version $Rev$ $Date: 2005-11-07 08:04:49 -0500 (Mon, 07 Nov 2005)
- *          $
+ * @version $Rev$ $Date$
  * @since Struts 1.1
  */
 public class JavascriptValidatorTag extends BodyTagSupport {
@@ -376,14 +375,16 @@
         Locale locale =
             TagUtils.getInstance().getUserLocale(this.pageContext, null);
 
-        Form form = resources.getForm(locale, formName);
-
-        if ("true".equalsIgnoreCase(dynamicJavascript) && (form == null)) {
-            throw new JspException("No form found under '" + formName
-                + "' in locale '" + locale
-                + "'.  A form must be defined in the "
-                + "Commons Validator configuration when "
-                + "dynamicJavascript=\"true\" is set.");
+        Form form = null;
+        if ("true".equalsIgnoreCase(dynamicJavascript)) {
+            form = resources.getForm(locale, formName);
+            if (form == null) {
+                throw new JspException("No form found under '" + formName
+                    + "' in locale '" + locale
+                    + "'.  A form must be defined in the "
+                    + "Commons Validator configuration when "
+                    + "dynamicJavascript=\"true\" is set.");
+            }
         }
 
         if (form != null) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org