Saturday, June 9, 2012

2 types of Spring Configuration

There are 2 types of specification you can put in the beginning of the XML in Bean configuration file.

One is using Spring 2.0 DTD to import the valid structure of a bean configuration. Here is the sample how it look like at the top of the configuration file:

< !DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd" >

< beans >
   ...
< /bean >

The other one is using XSD to define the valid structure of an XML bean configuration file.

< beans xmlns="http://www.springframework.org/schema/beans"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" >
   ...
< /beans>

Take noted.

No comments: