Spring配置文件applicationContext.xml的两种拆分方式

来源:互联网 发布:单片机比stc好 编辑:程序博客网 时间:2024/05/18 03:15


第一种:

通过web.xml配置加载spring上下文环境,其配置方式如下: 

web.xml

 

(在web.xml文件里面添加以上代码。只要将以applicationContext-开头的xml文件放到WEB-INF目录之下就可以了。一般会有applicationContext-service.xml和applicationContext-dao.xml。)


通过listener加载

或者利用severlet类加载



第二种方式:
使用Struts插件
在struts-config.xml中

原创粉丝点击