1.applicationContext.xml
<!--注解说明 -->
<context:annotation-config />
<!-- 把标记了@Controller注解的类转换为bean -->
<context:component-scan base-package="cn.godzilla" >
<context:[b]exclude[/b]-filter type="regex" expression="cn.godzilla.web.*"/>
</context:component-scan>
2.springmvc-servlet.xml
<!--注解说明 -->
<context:annotation-config />
<!-- 把标记了@Controller注解的类转换为bean -->
<context:component-scan base-package="cn.godzilla" >
<context:[b]include[/b]-filter type="regex" expression="cn.godzilla.web.*"/>
</context:component-scan>
<!--注解说明 -->
<context:annotation-config />
<!-- 把标记了@Controller注解的类转换为bean -->
<context:component-scan base-package="cn.godzilla" >
<context:[b]exclude[/b]-filter type="regex" expression="cn.godzilla.web.*"/>
</context:component-scan>
2.springmvc-servlet.xml
<!--注解说明 -->
<context:annotation-config />
<!-- 把标记了@Controller注解的类转换为bean -->
<context:component-scan base-package="cn.godzilla" >
<context:[b]include[/b]-filter type="regex" expression="cn.godzilla.web.*"/>
</context:component-scan>