<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans> <!-- ========================= GENERAL DEFINITIONS ========================= -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/classes/properties/jdbc.properties</value>
</list>
</property>
</bean> <!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= --> <!-- primary business object: default implementation -->
<bean id="adminFacade" class="net.chage.admin.service.AdminImpl">
<property name="cardDao"><ref bean="cardDao"/></property>
<property name="cardBatchDao"><ref bean="cardBatchDao"/></property>
<property name="proxyBatchDao"><ref bean="proxyBatchDao"/></property>
<property name="userDao"><ref bean="userDao"/></property>
<property name="roleDao"><ref bean="roleDao"/></property>
<property name="schoolDao"><ref bean="schoolDao"/></property>
<property name="sequenceDao"><ref bean="sequenceDao"/></property>
</bean>
<bean id="userPie" class="net.chage.admin.chartdata.UserPieChartData">
<property name="adminFacade"><ref bean="adminFacade"/></property>
</bean>
<bean id="cardTime" class="net.chage.admin.chartdata.CardTimeChartData">
<property name="adminFacade"><ref bean="adminFacade"/></property>
</bean>
</beans>
spring自带的例子中有的呀,怎么了,有什么问题?
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans> <!-- ========================= GENERAL DEFINITIONS ========================= -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/classes/properties/jdbc.properties</value>
</list>
</property>
</bean> <!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= --> <!-- primary business object: default implementation -->
<bean id="adminFacade" class="net.chage.admin.service.AdminImpl">
<property name="cardDao"><ref bean="cardDao"/></property>
<property name="cardBatchDao"><ref bean="cardBatchDao"/></property>
<property name="proxyBatchDao"><ref bean="proxyBatchDao"/></property>
<property name="userDao"><ref bean="userDao"/></property>
<property name="roleDao"><ref bean="roleDao"/></property>
<property name="schoolDao"><ref bean="schoolDao"/></property>
<property name="sequenceDao"><ref bean="sequenceDao"/></property>
</bean>
<bean id="userPie" class="net.chage.admin.chartdata.UserPieChartData">
<property name="adminFacade"><ref bean="adminFacade"/></property>
</bean>
<bean id="cardTime" class="net.chage.admin.chartdata.CardTimeChartData">
<property name="adminFacade"><ref bean="adminFacade"/></property>
</bean>
</beans>
spring自带的例子中有的呀,怎么了,有什么问题?
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans>
<!-- ========================= Start of PERSISTENCE DEFINITIONS ========================= --> <!-- DataSource Definition -->
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost/onetomany</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value></value>
</property>
</bean> <!-- Hibernate SessionFactory Definition -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>springstruts/com/from/student.hbm.xm.</value>
<value>springstruts/com/from/teacher.hbm.xml</value>
</list>
</property> <property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
<prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.HashtableCacheProvider</prop>
</props>
</property> <property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean> <!-- Spring Data Access Exception Translator Defintion -->
<bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator">
<property name="dataSource"><ref bean="dataSource"/></property>
</bean> <!-- Hibernate Template Defintion -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate.HibernateTemplate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
<property name="jdbcExceptionTranslator"><ref bean="jdbcExceptionTranslator"/></property>
</bean> <!-- teacher DAO Definition: Hibernate implementation -->
<bean id="teacherDAO" class="springstruts.com.service.teacherDAOhibernate">
<property name="hibernateTemplate"><ref bean="hibernateTemplate"/></property>
</bean> <!-- student DAO object: Hibernate implementation -->
<bean id="studentDAO" class="springstruts.com.service.studentDAOhibernate">
<property name="hibernateTemplate"><ref bean="hibernateTemplate"/></property>
</bean> <!-- ========================= Start of SERVICE DEFINITIONS ========================= --> <!-- Hibernate Transaction Manager Definition -->
<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
<!-- Transactional proxy for the Catalog Service
<bean id="catalogService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref local="transactionManager"/></property>
<property name="target"><ref local="catalogServiceTarget"/></property>
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>-->
</beans>
http://www.redsaga.com/mambo/component/option,com_docman/Itemid,29/task,view_category/catid,15/order,dmdate_published/ascdesc,DESC/