The tag checks to see if it is within a form tag, using TagUtils.assertHasAncestorOfType(this, FormTag.class, "errors", "form");
It looks like this is the only <form:*> tag that does this check.
This limits where the tag can be used to only a jsp compilation unit that contains the tag. Thus, it cannot be used in a jspf (fragment) that would be embedded within another jsp that contains the .
A workaround for now is to define a new tag library, with an alternate errors tag based on a class that derives from org.springframework.web.servlet.tags.form.ErrorsTag and overrides the onWriteTagContent() function. The new version simply does nothing (i.e. doesn't do the form check assert).
This workaround was tested and allows us to use the 'improved' tag within a jspf.
Affects: 2.0 final
Issue Links:
7462 form:errors not allowed in a nested JSP outside the scope of form:form ("is depended on by")
Fixed. The ErrorsTag no longer does an explicit check... I guess folks will have to read the documentation that states that the \ tag must be used nested within a \
Patrick Haren opened SPR-2753 and commented
The tag checks to see if it is within a form tag, using TagUtils.assertHasAncestorOfType(this, FormTag.class, "errors", "form");
It looks like this is the only <form:*> tag that does this check.
This limits where the tag can be used to only a jsp compilation unit that contains the tag. Thus, it cannot be used in a jspf (fragment) that would be embedded within another jsp that contains the .
A workaround for now is to define a new tag library, with an alternate errors tag based on a class that derives from org.springframework.web.servlet.tags.form.ErrorsTag and overrides the onWriteTagContent() function. The new version simply does nothing (i.e. doesn't do the form check assert).
This workaround was tested and allows us to use the 'improved' tag within a jspf.
Affects: 2.0 final
Issue Links:
7462 form:errors not allowed in a nested JSP outside the scope of form:form ("is depended on by")