AnsweredAssumed Answered

URGENT : context files order in web.xml

Question asked by alpha on Apr 19, 2007
Latest reply on Jan 6, 2008 by fogo
Hi guys,

I have a question that is very important to me. I have noticed in web.xml this code :
<context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>
         classpath:alfresco/application-context.xml
         classpath:alfresco/web-client-application-context.xml
         classpath:alfresco/web-scripts-application-context.xml
         classpath:web-services-application-context.xml
      </param-value>
      <description>Spring config file locations</description>
   </context-param>

The file application-context.xml is loaded before the other spring config file. This means that beans defined in web-client-application-context.xml, web-scripts-application-context.xml and web-services-application-context.xml cannot be overrided in extension/*-context.xml files. I've already run some tests because i needed to override bean
<bean id="webClientConfigSource">…</bean>
.

Is this done on purpose? If Yes, please tell me why.

I have also noticed in alfresco 1.4, the file application-context.xml was loaded after the other spring config files, allowing therefore to override all previous beans.

thanks

Outcomes