29-03-2012, 01:39 PM
XML Schema-based configuration
XML Schema 24.docx (Size: 26.75 KB / Downloads: 39)
Introduction
This appendix details the XML Schema-based configuration introduced in Spring 2.0.The central motivation for moving to XML Schema based configuration files was to make Spring XML
configuration easier. The 'classic' <bean/>-based approach is good, but its generic-nature comes with a price in
terms of configuration overhead.
From the Spring IoC containers point-of-view, everything is a bean. That's great news for the Spring IoC
container, because if everything is a bean then everything can be treated in the exact same fashion. The same,
however, is not true from a developer's point-of-view. The objects defined in a Spring XML configuration file
are not all generic, vanilla beans. Usually, each bean requires some degree of specific configuration.
The util schema
First up is coverage of the util tags. As the name implies, the util tags deal with common, utility
configuration issues, such as configuring collections, referencing constants, and suchlike.
To use the tags in the util schema, you need to have the following preamble at the top of your Spring XML
configuration file; the emboldened text in the snippet below references the correct schema so that the tags in the
util namespace are available to you.
The jee schema
The jee tags deal with JEE (Java Enterprise Edition)-related configuration issues, such as looking up a JNDI
object and defining EJB references.
To use the tags in the jee schema, you need to have the following preamble at the top of your Spring XML
configuration file; the emboldened text in the following snippet references the correct schema so that the tags in
the jee namespace are available to you.