InterviewSolution
| 1. |
What Is Spring Java Based Configuration? Give Some Annotation Example.? |
|
Answer» Java BASED CONFIGURATION option enables you to write most of your Spring configuration without XML but with the help of few Java-based ANNOTATIONS. For example: Annotation @Configuration indicates that the class can be USED by the Spring IOC container as a source of bean definitions. The @Bean annotation tells Spring that a method annotated with @Bean will return an object that should be registered as a bean in the Spring application context. Java based configuration option enables you to write most of your Spring configuration without XML but with the help of few Java-based annotations. For example: Annotation @Configuration indicates that the class can be used by the Spring IoC container as a source of bean definitions. The @Bean annotation tells Spring that a method annotated with @Bean will return an object that should be registered as a bean in the Spring application context. |
|