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.
Spring Framework new release 4.3 make some Web Improvements. Among that, it simplifies way to implement Bean Scopes (Request, Session and Application scopes) using Annotation: @RequestScope | @SessionScope | @ApplicationScope. They are only valid in the context of a web-aware Application.
Spring Expression Language (SpEL) is a powerful expression language that supports querying and manipulating an object graph at runtime.
This tutorial shows various examples of ways to use SpEL expressions with XML and annotation based configuration. We also know how to evaluate an expression using SpEL classes and interfaces.
@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.
Callable is a Java interface that is an useful methodology for control multi-threading returns on concurrency development.
The tutorial will guide you to build a concurrency program with ThreadPoolTaskExecutor of Spring Framework and Callable interface.
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.
Spring based configuration using Annotation help you to create Spring configurations without XML.
This tutorial give you an example with most of Spring Annotation for configuration: @Configuration, @Bean (with custom bean lifecycle method), @Import, @Scope. And they’re in multi-configuration context.