<!-- 指定Spring需要扫描的包,并将所有是别的类放到容器中,便于识别被注解的受托管bean -->
<context:component-scan base-package="com.sgfm" scoped-proxy="interfaces"> <context:exclude-filter type="regex" expression="com.sgfm.base.jms.demo.*" /> <!--扫描这个包下的所有的bean bean的类型包括@contorller @entity @service --> </context:component-scan>
//获取某个bean的通过类名首字母小写
eg:
IndexAction action = (IndexAction) app.getBean("indexAction");