Added check for use of "ref" with other attributes in <authentication-provider>.

This commit is contained in:
Luke Taylor 2010-07-20 14:31:52 +01:00
parent ea5f2088b5
commit a4fd191499
1 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,10 @@ public class AuthenticationManagerBeanDefinitionParser implements BeanDefinition
if (node instanceof Element) {
Element providerElt = (Element)node;
if (StringUtils.hasText(providerElt.getAttribute(ATT_REF))) {
if (providerElt.getAttributes().getLength() > 1) {
pc.getReaderContext().error("authentication-provider element cannot be used with other attributes " +
"when using 'ref' attribute", pc.extractSource(element));
}
NodeList providerChildren = providerElt.getChildNodes();
for (int j = 0; j < providerChildren.getLength(); j++) {
if (providerChildren.item(j) instanceof Element) {