Notes On Spring Core and Spring Boot
Notes On Spring Core and Spring Boot
Spring Container
By Amol Limaye: https://www.linkedin.com/in/amolrlimaye/ 6
Important terms
Configuration related
• @Configuration – Indicates a class declaring one or
more beans
• @Import – Import a configuration class
• @ImportResource – Import spring configuration
from a resource file e.g. XML
• @PropertySource – Load properties from a file and
map onto a POJO class
By Amol Limaye: https://www.linkedin.com/in/amolrlimaye/ 11
Important annotations
Others
• @Bean – Method level annotation to create a spring bean
• @Primary – Mark a bean as primary in case of multiple autowire
candidates
• @Lazy – Create bean on first access instead of startup
• @DependsOn – Make sure other beans are created before current bean
• @Qualifier – Give the name of the bean during autowiring used when
there are multiple autowiring candidates
• @Profile – This is a way to segregate parts of your application
configuration and make it available only in certain environment