Commits

Anonymous committed 98cc070

Improved fix for WW-584 based on reporter's suggestion. Don't cache registered validators as there is no guarantee on how tags are cached.

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@483573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 5750efb

Comments (0)

Files changed (2)

src/java/com/opensymphony/webwork/views/jsp/ui/AbstractUITag.java

             // register ScriptValiationAware validators for this UI tag with the form
             Boolean validate = (Boolean) formTag.getParameters().get("validate");
 
-            if ((validate != null) && validate.booleanValue() && (formTag.getActionClass() != null) && (formTag.getActionName() != null) && formTag.isValidatorRegsitrationOpen()) {
+            if ((validate != null) && validate.booleanValue() && (formTag.getActionClass() != null) && (formTag.getActionName() != null)) {
                 findScriptingValidators(formTag, (String) name, formTag.getActionClass(), null);
             }
         }

src/java/com/opensymphony/webwork/views/jsp/ui/FormTag.java

 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.JspException;
 
 
 /**
     String methodAttr;
     String namespaceAttr;
     String validateAttr;
-    private boolean m_isValidatorRegistrationOpen = true;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
         this.validateAttr = validate;
     }
 
-    public boolean isValidatorRegsitrationOpen() {
-        return m_isValidatorRegistrationOpen;
-    }
-
-    public int doEndTag() throws JspException {
-        m_isValidatorRegistrationOpen = false;
-
-        return super.doEndTag();
-    }
-
     public void evaluateExtraParams(OgnlValueStack stack) {
         super.evaluateExtraParams(stack);
 
      * there will be duplicate validators if the tag is cached.
      */
     public void registerValidator(ScriptValidationAware sva, Map params) {
-        if (!m_isValidatorRegistrationOpen) {
-            return;
-        }
-
         if (fieldValidators == null) {
             fieldValidators = new ArrayList();
             fieldParameters = new ArrayList();
     protected boolean evaluateNameValue() {
         return false;
     }
+
+    /**
+     * Resets the attributes of this tag so that the tag may be reused.  As a general rule, only
+     * properties that are not specified as an attribute or properties that are derived need to be
+     * reset.  Examples of this would include the parameters Map in ParameterizedTag and the
+     * namespace in the ActionTag (which can be a derived value). <p /> This should be the last
+     * thing called as part of the doEndTag
+     */
+    protected void reset() {
+        super.reset();
+
+        if (fieldValidators != null) {
+            fieldValidators.clear();
+            fieldParameters.clear();
+        }
+    }
 }