Some Spring3 packages are skipped.
Project organization diagram 1
Project Organization 2
Spring configuration file
<? Xml version = "1.0" encoding = "UTF-8"?>
<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-3.0.xsd>
<Bean id = "jdbcTemplate" class = "org. springframework. jdbc. core. JdbcTemplate">
<Property name = "dataSource">
<Ref local = "dataSource"/>
</Property>
</Bean>
<Bean class = "org. springframework. beans. factory. config. PropertyPlaceholderConfigurer">
<Property name = "locations" value = "/WEB-INF/conf/jdbc. properties"/>
</Bean>
<Bean id = "dataSource" class = "org. apache. commons. dbcp. BasicDataSource" destroy-method = "close">
<Property name = "driverClassName" value = "$ {jdbc. driverClassName}"/>
<Property name = "url" value = "$ {jdbc. url}"/>
<Property name = "username" value = "$ {jdbc. username}"/>
<Property name = "password" value = "$ {jdbc. password}"/>
</Bean>
<Bean id = "userDAO" class = "com. test. dao. UserDao">
<Property name = "jdbcTemplate">
<Ref bean = "jdbcTemplate"/>
</Property>
</Bean>
<Bean id = "TestBo"
Class = "test. TestBo">
</Bean>
<Bean id = "TestAction" class = "test. TestAction">
</Bean>
</Beans>
After the overall configuration, it seems that the data management is simplified, but you have to write the RowMapper corresponding to each object class, which is not much simplified.