<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=kdonald" rel="nofollow">Keith Donald</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6306?redirect=false" rel="nofollow">SPR-6306</a></strong> and commented</p>
<p dir="auto">Spring MVC setup could be simplified considerably by adding a custom XML namespace. A simple tag to configure mvc:annotated-controllers/ with reasonable default settings would be a great start.</p>
<p dir="auto">Example benefits:</p>
<p dir="auto"><strong>AFTER MVC NAMESPACE</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
    xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd&quot;&gt;

	&lt;mvc:annotation-driven/&gt;
	
&lt;/beans&gt;
"><pre class="notranslate"><code class="notranslate">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;

	&lt;mvc:annotation-driven/&gt;
	
&lt;/beans&gt;

</code></pre></div>
<p dir="auto"><strong>BEFORE MVC NAMESPACE</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xsi:schemaLocation=&quot;
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd&quot;&gt;

	&lt;!-- HANDLER MAPPING RULES --&gt;
	
	&lt;!-- Maps requests to @Controllers based on @RequestMapping(&quot;path&quot;) annotation values
		 If no annotation-based path mapping is found, Spring MVC sends a 404 response and logs a pageNotFound warning. --&gt;
	&lt;bean class=&quot;org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping&quot;&gt;
		&lt;property name=&quot;order&quot; value=&quot;1&quot; /&gt;
	&lt;/bean&gt;
	
	&lt;!-- REGISTERED HANDLER TYPES --&gt;

	&lt;!-- Enables annotated @Controllers; responsible for invoking an annotated POJO @Controller when one is mapped. --&gt;

	&lt;bean class=&quot;org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter&quot;&gt;
		&lt;!-- Configures Spring MVC DataBinder instances globally --&gt;
		&lt;property name=&quot;webBindingInitializer&quot;&gt;
			&lt;bean class=&quot;org.springframework.web.bind.support.ConfigurableWebBindingInitializer&quot;&gt;
				&lt;property name=&quot;conversionService&quot; ref=&quot;conversionService&quot; /&gt;
				&lt;property name=&quot;validator&quot; ref=&quot;validator&quot; /&gt;
			&lt;/bean&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;!-- FIELD TYPE CONVERSION AND VALIDATION --&gt;
	
	&lt;!-- Enables the Spring 3 Type Conversion system that uses Joda Time Formatting for Date/Time types --&gt;
	&lt;bean id=&quot;conversionService&quot; class=&quot;org.springframework.samples.petclinic.util.PetclinicConversionServiceFactory&quot; /&gt;
	
	&lt;!-- Configures JSR-303 Declarative Validation with default provider on classpath (Hibernate Validator) --&gt;
	&lt;bean id=&quot;validator&quot; class=&quot;org.springframework.validation.beanvalidation.LocalValidatorFactoryBean&quot; /&gt;
	
&lt;/beans&gt;
"><pre class="notranslate"><code class="notranslate">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"&gt;

	&lt;!-- HANDLER MAPPING RULES --&gt;
	
	&lt;!-- Maps requests to @Controllers based on @RequestMapping("path") annotation values
		 If no annotation-based path mapping is found, Spring MVC sends a 404 response and logs a pageNotFound warning. --&gt;
	&lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"&gt;
		&lt;property name="order" value="1" /&gt;
	&lt;/bean&gt;
	
	&lt;!-- REGISTERED HANDLER TYPES --&gt;

	&lt;!-- Enables annotated @Controllers; responsible for invoking an annotated POJO @Controller when one is mapped. --&gt;

	&lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"&gt;
		&lt;!-- Configures Spring MVC DataBinder instances globally --&gt;
		&lt;property name="webBindingInitializer"&gt;
			&lt;bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer"&gt;
				&lt;property name="conversionService" ref="conversionService" /&gt;
				&lt;property name="validator" ref="validator" /&gt;
			&lt;/bean&gt;
		&lt;/property&gt;
	&lt;/bean&gt;

	&lt;!-- FIELD TYPE CONVERSION AND VALIDATION --&gt;
	
	&lt;!-- Enables the Spring 3 Type Conversion system that uses Joda Time Formatting for Date/Time types --&gt;
	&lt;bean id="conversionService" class="org.springframework.samples.petclinic.util.PetclinicConversionServiceFactory" /&gt;
	
	&lt;!-- Configures JSR-303 Declarative Validation with default provider on classpath (Hibernate Validator) --&gt;
	&lt;bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" /&gt;
	
&lt;/beans&gt;

</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC1</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="398063667" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6422" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6422/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6422">#6422</a> Add schema for web configuration (handler mappings) (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto">1 votes, 3 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=belamiru" rel="nofollow">Mikhail Moussikhine</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9133?redirect=false" rel="nofollow">SPR-9133</a></strong> and commented</p>
<p dir="auto"><code class="notranslate">@Configuration</code><br>
<code class="notranslate">@PropertySource</code>({ "${property1}", "${property2}" })<br>
class AppConfig {<br>
}</p>
<p dir="auto">Only first ${property1} placeholder will be resolved. Second and any other values will be used as is. The cause and fix are simple:</p>
<p dir="auto">File:<br>
./org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java</p>
<p dir="auto">Function:<br>
protected AnnotationMetadata doProcessConfigurationClass(ConfigurationClass configClass, AnnotationMetadata metadata) {}</p>
<p dir="auto">Line: 187<br>
for (int i = 0; i &lt; nLocations; i++) {<br>
locations[0] = this.environment.resolveRequiredPlaceholders(locations[0]);<br>
}</p>
<p dir="auto">Should be:<br>
for (int i = 0; i &lt; nLocations; i++) {<br>
locations[i] = this.environment.resolveRequiredPlaceholders(locations[i]);<br>
}</p>
<p dir="auto">Just a typo, I guess.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.1</p>
<p dir="auto"><strong>Sub-tasks:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117394" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13775" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13775/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13775">#13775</a> Backport "Fix regression in <code class="notranslate">@PropertySource</code> placeholder resolution"</li>
</ul>
<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="398117355" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13770" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13770/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13770">#13770</a> Multiple PropertySource fails to use System property (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398118960" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14016" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14016/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14016">#14016</a> Resolving ${} system properties in <code class="notranslate">@PropertySource</code> annotation does not work anymore (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117311" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13766" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13766/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13766">#13766</a> <code class="notranslate">@PropertySource</code> annotation with multiple values and a name fails to register all property sources</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/e30d6104f367eb416c420ef801a8f152201443cd/hovercard" href="https://github.com/spring-projects/spring-framework/commit/e30d6104f367eb416c420ef801a8f152201443cd"><tt>e30d610</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/4df2a14b13ac41d71f8034fa68e1b7e54e3f7a48/hovercard" href="https://github.com/spring-projects/spring-framework/commit/4df2a14b13ac41d71f8034fa68e1b7e54e3f7a48"><tt>4df2a14</tt></a></p>