I am a newbie to the world of Spring. In an interview, it was asked if we can create a bean in XML without specifying the class
(that is, the bean would only have an id
attribute). I did not have the answer to this. Please advise if we can create a bean in XML in Spring without specifying the class attribute and under which conditions we would normally do this.
相关问题
- java.lang.IllegalArgumentException: Cannot set to
- What uses more memory in c++? An 2 ints or 2 funct
- Spring Data MongoDB - lazy access to some fields
- Declaring an explict object dependency in Spring
- Decoding body parameters with Spring
相关文章
- java JDK动态代理和cglib动态代理最后获取的代理对象都为null的问题
- org.xml.sax.SAXParseException; lineNumber: 7; colu
- SpringMVC如何把File封装到Map中?
- Spring: controller inheritance using @Controller a
- How to load @Configuration classes from separate J
- Java spring framework - how to set content type?
- Java/Spring MVC: provide request context to child
- Spring 5 Web Reactive - Hot Publishing - How to us
Spring documentation makes it quite clear:
This section explains it in detail and provides useful examples.
As described by Szymon, bean definition inheritance is one way. Schema based configuration is another way, see. For example, taken from Spring's documentation,