Spring Framework provides Spring Factory Method mechanics to create Beans from static(non-static) method of a Factory Class in XML config files. In the tutorial, JavaSampleApproach will introduce Spring Factory Method with sample codes.
@Resource Annotation is used to indicate a reference to a resource, it is considered an alternative to @Autowired which is an Spring standard. Similar to Java EE 5, we can use @Resource Annotation with field injection or setter method.
This tutorial will cover those kinds of injection which will be used for matching by Name, Type or Qualifier.
Security is an important of a Web Application, So The tutorial will guide you how to configure Security for a Web Application with Spring Boot.
– How to use Spring Security JDBC Authentication with PostgreSQL & Spring Boot
– Spring Security – Customize Authentication Provider
– Spring Security – Customize Login Handler
– Spring Security Customize Logout Handler
In application development, sometimes we should make different configuration for each environment. Spring Profiles provides a way to separate application configuration into some parts and they are only available in one or more specific environments.
This tutorial introduces ways to use Spring Profiles by @Profile Annotation or XML Configuration.
@Value Annotations vs Environment vs @ConfigurationProperties.
This tutorial helps you have a comparison view covering those solutions.
We can load properties value from Properties file to Spring Environment just by using @PropertySource annotation. This tutorial shows you the simple way to get them from Environment object.
– Inject Properties from Properties File using @Value annotation
– Inject Properties from Properties File using @ConfigurationProperties Annotation
– How to use Spring Factory Method to create Spring Bean
This tutorial will show you the better way to handle properties using @ConfigurationProperties Annotation.
In previous article, we have learned about using @Value annotation to inject properties from properties file. This approach has disadvantage that if we wanna change any property, we have to update all files which referenced it.
This tutorial shows you the way to inject Properties from Properties File using @Value Annotation with Java Configuration and @PropertySource.
You will also know how to use SourcesPlaceHolder and ConversionService for specific cases including: List/Arrays, special types (DateTime, Pattern), when a value that should be treated as null or a placeholder fails to resolve.
annotation-config and component-scan are important basic concepts of Spring Core.
This tutorial helps you understand how to use them and difference between them.
At the Core of Spring Framework, Spring IoC (Inversion of Control) is implemented using the Dependency Injection design pattern. The Spring IoC Container creates, configures and connects the objects (which are called Beans), then manage their life cycle.
This tutorial introduce principle of Spring IoC and a simple example using Containers to you.
The tutorial shows you the way to implement Bean Scopes (Singleton, Prototype, Request and Session) using Annotation @Scope. Except Singleton and Prototype Scope, the others are only valid in the context of a web-aware Application.
Related Article: Spring Bean Scope – Singleton and Prototype
The Spring Framework consists of features organized into various modules. A module specifies to an area. These modules are grouped into Core Container, Data Access/Integration, Web, AOP (Aspect Oriented Programming), Instrumentation, Messaging, and Test.
This tutorial gives you an introduction of Spring Framework.