菜鸟有一问题请教:
任务描述:我采用struts1.2+hibernate3.0+spring2.0搭建框架,开发项目。在使用dwr技术实现检查机构名是否存在功能。功
能实现在业务层,由于要调用数据层的方法,我使用spring的依赖注入方式,将数据层实现类注入到数据层的接口对象。
问题描述:在web.xml中配置dwr方式一:
dwr
org.directwebremoting.servlet.DwrServlet
debug
true
dwr
/dwr/*
这样配置,无法实现注入,数据层接口对象为null;
在web.xml中配置dwr方式二:
在以上配置上加入以下:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
这种方式spring配置文件会重复加载,因为在strut配置文件中添加对spring的支持是采用插件方式。
我的问题:怎样解决重复加载spring配置文件?