Tags: spring

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 […]

Read More →

MessageSource in Spring 3

The MessageSource interface supports the parameterization and internationalization of messages and provides 2 implementations: ResourceBundleMessageSource, built on top of the standard ResourceBundle ReloadableResourceBundleMessageSource, being able to reload message definitions without restarting the VM The following is an example of ResourceBundleMessageSource to get messages in the specified language in Spring 3.

Read More →

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 […]

Read More →

Basic configuration of Log4j in Spring using a .properties file

There are 2 ways to configure Log4j in Spring using: a .properties file a .xml file The configuration with the. xml file allows to take advantage of some aspects that can not be configured with the .properties file that is therefore regarded as obsolete. This article will explain how to configure Log4j using the .properties […]

Read More →