Spring Bean Name with package detail only -
i need create bean id or name class name it's package.
e.g
<bean class="org.chameleon.commons.context.resolver.impl.usercontextresolver" scope="prototype" />
and want this
org.chameleon.commons.context.resolver.impl.usercontextresolver
but shows me this.
org.chameleon.commons.context.resolver.impl.usercontextresolver@if
what bean required name.
you should add "id" or "name" attribute bean definition, e.g.
<bean id="org.chameleon.commons.context.resolver.impl.usercontextresolver" class="org.chameleon.commons.context.resolver.impl.usercontextresolver" scope="prototype" />
as stated in spring reference doc 5.3.1 naming beans1
in xml-based configuration metadata, you use id and/or name attributes specify bean identifier(s). id attribute allows specify 1 id. conventionally these names alphanumeric (mybean, fooservice, etc.), may contain special characters well. if want introduce other aliases bean, can specify them in name attribute, separated comma (,), semicolon (;), or white space. as historical note, in versions prior spring 3.1, id attribute defined xsd:id type, constrained possible characters. of 3.1, defined xsd:string type. note bean id uniqueness still enforced container, though no longer xml parsers. not required supply name or id bean. if no name or id supplied explicitly, container generates unique name bean. however, if want refer bean name, through use of ref element or service locator style lookup, must provide name.
Comments
Post a Comment