web中有几种配置spring的方式

2025-03-22 12:19:51
推荐回答(1个)
回答1:

spring有三种启动方式,使用ContextLoaderServlet,ContextLoaderListener和ContextLoaderPlugIn
spring3.0及以后版本中已经删除ContextLoaderServlet 和Log4jConfigServlet
可以采用余下两种启动方式ContextLoaderListener和ContextLoaderPlugIn
建议使用ContextLoaderListener

N0:1





org.springframework.web.context.ContextLoaderListener




contextConfigLocation
/WEB-INF/applicationContext.xml


N0:2




context
org.springframework.web.context.ContextLoaderServlet
1
-->

N0:3