Issue 1:
Keith Donald opened SPR-6306 and commented

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.

Example benefits:

AFTER MVC NAMESPACE

<?xml version="1.0" encoding="UTF-8"?>
<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">

<mvc:annotation-driven/>

</beans>

BEFORE MVC NAMESPACE

<?xml version="1.0" encoding="UTF-8"?>
<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">

<!-- HANDLER MAPPING RULES -->

<!-- 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. -->
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="order" value="1" />
</bean>

<!-- REGISTERED HANDLER TYPES -->

<!-- Enables annotated @Controllers; responsible for invoking an annotated POJO @Controller when one is mapped. -->

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

<!-- FIELD TYPE CONVERSION AND VALIDATION -->

<!-- Enables the Spring 3 Type Conversion system that uses Joda Time Formatting for Date/Time types -->
<bean id="conversionService" class="org.springframework.samples.petclinic.util.PetclinicConversionServiceFactory" />

<!-- Configures JSR-303 Declarative Validation with default provider on classpath (Hibernate Validator) -->
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />

</beans>

Affects: 3.0 RC1

Issue Links:

#6422 Add schema for web configuration (handler mappings) ("duplicates")

1 votes, 3 watchers

Issue 2:
Mikhail Moussikhine opened SPR-9133 and commented

@Configuration

@PropertySource({ "${property1}", "${property2}" })

class AppConfig {

}

Only first ${property1} placeholder will be resolved. Second and any other values will be used as is. The cause and fix are simple:

File:

./org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

Function:

protected AnnotationMetadata doProcessConfigurationClass(ConfigurationClass configClass, AnnotationMetadata metadata) {}

Line: 187

for (int i = 0; i < nLocations; i++) {

locations[0] = this.environment.resolveRequiredPlaceholders(locations[0]);

}

Should be:

for (int i = 0; i < nLocations; i++) {

locations[i] = this.environment.resolveRequiredPlaceholders(locations[i]);

}

Just a typo, I guess.

Affects: 3.1.1

Sub-tasks:

#13775 Backport "Fix regression in @PropertySource placeholder resolution"

Issue Links:

#13770 Multiple PropertySource fails to use System property ("is duplicated by")

#14016 Resolving ${} system properties in @PropertySource annotation does not work anymore ("is duplicated by")

#13766 @PropertySource annotation with multiple values and a name fails to register all property sources

Referenced from: commits e30d610, 4df2a14