-
加载Controller(spring-mvc.xml)
<context:component-scan base-package="com.buss.*">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
context:component-scan>
-
加载service(spring-mvc-hibernate.xml)
<context:component-scan base-package="com.buss.*">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
context:component-scan>
-
扫描hibernate实体(spring-mvc-hibernate.xml)
如果生成代码时,代码分层风格选择了“代码分层”,则配置文件如下:
<property name="packagesToScan">
<list>
....
<value>com.buss.entity.*value>
<value>com.buss.*.entityvalue>
list>
property>