默认加载applicationContext.xml执行两边init-method的问题(WSS
-----------------------------------------①----------------------------------------------------- 一般情况下,不写 下面的代码,就无法加载spring的配置文件 <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/*Context.xml</param-value> </context-param> ------------------------------------------②----------------------------------------------------- 如果一个web项目,加载了applicationContext.xml,但是在web.xml中没写上面两端代码,可能是因为这是一个WS, <listener> <listener-class> com.sun.xml.ws.transport.http.servlet.WSServletContextListener </listener-class> </listener>
---------------------------------------------------------------------------------------------- 所以,如果一个WebService项目,web.xml中写了②中的代码,不能在加①中的代码,否则会加载两边,如果有初始化方法会出现问题 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |