属性的Spring MVC应用程序
问题描述:
我下spring-app.xml
属性的Spring MVC应用程序
<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="annotatedClasses">
<list>
<value>com.mmi.education.dao.User</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
</bean>
而不是财产annotatedClasses读取Bean代码,我想指定包。
可能吗?
另外什么是可以在bean标签下指定的有效属性?
答
<property name="packagesToScan">
<list>
<value>com.mmi.education.dao</value>
</list>
</property>
查看Spring的文档here其他属性。