Tag: bean
-
How to set a default method to running code on the creation or destruction of a bean
In the post Executing code on the creation or destruction of a bean in Spring I explain three ways to execute code on the creation or destruction of a Bean in Spring. With two of these ways you can set the execution of a specific custom method: with the annotations @PostConstruct and @PreDestroy configuring the…
-
PropertyEditors in Spring 3
PropertyEditor is an interface that provides a support for the conversion of the value of a property (usually of type String) in an object that can be Date, URL, etc.
-
Executing code on the creation or destruction of a bean in Spring
There are 3 ways to execute code to create a bean in Spring: with the annotation @PostConstruct implementing the interface InitializingBean configuring the property init-method The reason why you run code when you create a bean is often to check the dependencies, and assign a default value, or automated actions such as starting a scheduled…