From 529817301f763ed3e858cda99cdd5b09d5304dd3 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Mon, 14 Mar 2011 11:10:12 +0000 Subject: [PATCH] Docs reflect bean id change from xsd:ID->xsd:string Issue: SPR-8054 --- spring-framework-reference/src/beans.xml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/spring-framework-reference/src/beans.xml b/spring-framework-reference/src/beans.xml index 308520e6fa..50dc56bbdc 100644 --- a/spring-framework-reference/src/beans.xml +++ b/spring-framework-reference/src/beans.xml @@ -532,16 +532,17 @@ List userList service.getUsernameList(); In XML-based configuration metadata, you use the id and/or name attributes to specify the bean identifier(s). The id attribute - allows you to specify exactly one id, and because it is a real XML - element ID attribute, the XML parser can do some extra validation when - other elements reference the id. As such, it is the preferred way to - specify a bean identifier. However, the XML specification does limit the - characters that are legal in XML ids. This is usually not a constraint, - but if you need to use one of these special XML characters, or want to - introduce other aliases to the bean, you can also specify them in the - name attribute, separated by a comma - (,), semicolon (;), or white - space. + allows you to specify exactly one id. Conventionally these names are + alphanumeric ('myBean', 'fooService', etc), but may special characters + as well. If you want to introduce other aliases to the bean, you can + also specify them in the name attribute, separated by + a comma (,), semicolon (;), or + white space. As a historical note, in versions prior to Spring 3.1, the + id attribute was typed as an + xsd:ID, which constrained possible characters. As of + 3.1, it is now xsd:string. Note that bean id + uniqueness is still enforced by the container, though no longer by XML + parsers. You are not required to supply a name or id for a bean. If no name or id is supplied explicitly, the container generates a unique name for