Displaying posts written in

June 2010

Jun
9
2010

How to Configure Spring beans.xml File: The Use of PropertyPlaceholderConfigurer

The file “beans.xml” used for you application is already a kind of configuration file. However, this file is designed for the developer who can quickly customize the application with less coding changes. It is not recommended for an end user to change the file.
For example, you can, of course, define the database connection properties in [...]

Jun
7
2010

How to Configure Spring beans.xml File: Collection properties and EntityManagerFactory Examples

Java beans in Spring can also have their collection properties populated in the beans.xml file. The collection properties here mean things like List, Map and Array.
For example, if you want to create a JPA EntityManagerFactory with a set of connection properties, these properties can be configured in beans.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" [...]