Возможно ли иметь эквивалент <mvc:default-servlet-handler/>
, определенный в AnnotationConfig(Web)ApplicationContext
? Прямо сейчас у меня есть:
@Configuration
@ImportResource("classpath:/mvc-resources.xml")
class AppConfig {
// Other configuration...
}
только в моем resources/mvc-resources.xml
:
<?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-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<mvc:default-servlet-handler/>
</beans>
И он работает так, как ожидалось. Можно ли это сделать без импорта XML файла? Было бы неплохо сбить какой-нибудь шаблон.