How to write Custom Spring Callback Methods?

spring

A Spring process follows bean based approach.The Spring bean is created, managed and dispensed by the Spring IoC container. Each Spring bean has a lifecycle and the lifecycle has to undergo the following stages: Instantiate – The Spring container instantiates the bean. Populate properties- Spring IoC container injects the bean’s properties. Set Bean Name- Spring […]

Custom Scope for Spring Beans

spring

In my previous posts Spring bean scopes (Singleton and Prototype) with example and Spring bean scopes (Request, Session, Global Session) with example I discussed about the bean scopes in spring. There’s one more scope which I forgot to mention, its the Thread scope. The spring documentation states that As of Spring 3.0, a thread scope […]

Spring bean scopes (Request, Session, Global Session) with example

output

When you define a bean in the configuration file, you are just defining the structure of the bean or it is just a class. With that definition, you can create any number of instances. Here the advantage of the bean is that, you are not only allowed to define the dependencies for the beans, you […]

Spring bean scopes (Singleton and Prototype) with example

spring

When you define a bean in the configuration file, you are just defining the structure of the bean or it is just a class. With that definition, you can create any number of instances. Here the advantage of the bean is that, you are not only allowed to define the dependencies for the beans, you […]

Annotation Based Bean Wiring @Autowired in Spring framework

spring

Since Spring 2.5, one of the most interesting ways of wiring beans in Spring has been to use annotations to automatically wire bean properties. Auto wiring with annotations isn’t much different than using the autowire attribute in XML. But it does allow for more fine-grained auto wiring, where you can selectively annotate certain properties for […]

Introduction to Spring Validation

spring-thumbnail

In this article, we will see the usage of Spring Validators. Spring provides a simplified set of APIs and supporting classes for validating domain objects. As always, the framework is extensible and it is possible to hook-in custom validator implementations into the framework. This article starts in explaining the basics of Spring validator by guiding […]

Extending View Resolver and Chaining View Resolvers in Spring MVC

spring-thumbnail

In Spring MVC view resolvers help the Dispatcher Servlet in identifying the views which has to be rendered in response for a request. There are lot view resolvers available in Spring framework. For example: InternalResourceViewResolver, ResourceBundleViewResolver, XmlViewResolver etc. If needed, the programmers can have custom view resolvers by extending existing view resolver implementation or implementing […]

Testing Support in Spring Framework

spring-thumbnail

Testing is a vital phase in any software application and software cannot be complete if it is not completely tested. Unit Testing allows individual software components to be tested completely whereas Integration Testing ensures that multiple components in a system works fine. also read: Spring Tutorials Spring 4 Tutorials Spring Interview Questions In this article, […]

Email Integration in Spring Framework

spring-thumbnail

1)Introduction The Spring Framework provides a supportive utility library for sending email that shields the user from the essentials of the core mailing system and is dependable for low level resource handling on behalf of the customer. Spring Framework uses the following package as a root level package for the email support: org.springframework.mail MailSender is […]

How to lazy initialize Spring beans?

spring-thumbnail

Lazy Initiation in Spring IOC As we know Spring’s bean factory is pre-initiate all the beans when first time creating the factory. This is good practice because if there is any dependency error everything can be resolved at the time of start up. This is not case in all the application scenarios. The following are the few drawbacks […]