<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=marvi" rel="nofollow">Markus Härnvi</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1360?redirect=false" rel="nofollow">SPR-1360</a></strong> and commented</p>
<p dir="auto">I would like to chain two template loaders, one that looks in a database and one looking in the classpath. Today I could subclass FreemarkerConfigurer and override postProcessConfiguration().</p>
<p dir="auto">It would be great to use the BeanFactory to create and wire template loaders with the Freemarker configuration.</p>
<p dir="auto"><a href="http://forum.springframework.org/viewtopic.php?p=37140#37140" rel="nofollow">http://forum.springframework.org/viewtopic.php?p=37140#37140</a></p>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.2.5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398061161" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6132" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6132/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6132">#6132</a> Allow declarative addition of FreeMarker TemplateLoader's to FreeMarkerConfigurer (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=bfovez" rel="nofollow">Bertrand Fovez</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6493?redirect=false" rel="nofollow">SPR-6493</a></strong> and commented</p>
<p dir="auto">The tag &lt;import resource="..."/&gt; acts differently in version 3.0.0 and 2.5.6.<br>
For example, consider these two xml configuration files, located in a package "context".</p>
<p dir="auto">File: dependent-context.xml</p>
<hr>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd%22%3E" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;</a><br>
&lt;bean id="myBean" class="java.lang.String" /&gt;<br>
&lt;/beans&gt;</p>
<p dir="auto">File: super-context.xml</p>
<hr>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd%22%3E" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;</a><br>
&lt;import resource="dependent-context.xml" /&gt;<br>
&lt;/beans&gt;</p>
<p dir="auto">We load the latter, using the following:<br>
new ClassPathXmlApplicationContext("context/super-context.xml");</p>
<p dir="auto">Here is the log using Spring 2.5.6.SEC01:</p>
<hr>
<p dir="auto">11:47:58,903 INFO  [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@19efb05: display name [org.springframework.context.support.ClassPathXmlApplicationContext@19efb05]; startup date [Wed Dec 02 11:47:58 CET 2009]; root of context hierarchy<br>
11:47:58,949 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [context/super-context.xml]<br>
11:47:59,027 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [context/dependent-context.xml]<br>
11:47:59,059 INFO  [ClassPathXmlApplicationContext] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@19efb05]: org.springframework.beans.factory.support.DefaultListableBeanFactory@47393f<br>
11:47:59,059 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@47393f: defining beans [myBean]; root of factory hierarchy</p>
<p dir="auto">Note that the dependent-context.xml file is loaded as "class path resource [context/dependent-context.xml]"</p>
<p dir="auto">Here is the log using Spring 3.0.0.RC3:</p>
<hr>
<p dir="auto">12:06:57,312 INFO  [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@8814e9: startup date [Wed Dec 02 12:06:57 CET 2009]; root of context hierarchy<br>
12:06:57,608 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [context/super-context.xml]<br>
12:06:57,686 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from URL [file:/C:/Workspace/__Test/target/classes/context/dependent-context.xml]<br>
12:06:57,795 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a9334: defining beans [myBean]; root of factory hierarchy</p>
<p dir="auto">Note that the dependent-context.xml file is new loaded as "URL [file:/C:/Workspace/__Test/target/classes/context/dependent-context.xml]"</p>
<p dir="auto">If the two file are located in different folders on the file system, as it is often the case, the loading fails.</p>
<p dir="auto">This difference generates several major regressions in our existing projects.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC3</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398100320" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11160" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11160/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11160">#11160</a> Regression about the suppport of the tag  (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/09a55c8edec4af7abc59b2193e2eb2109ccd84c3/hovercard" href="https://github.com/spring-projects/spring-framework/commit/09a55c8edec4af7abc59b2193e2eb2109ccd84c3"><tt>09a55c8</tt></a></p>