I am building a new application that configures spring through a java config rather than xml. This app is dependent on a module that uses the xml style config. When I try an
In your configuration class, you can import xml configuration via the @ImportResource annotation.
Something like this:
@Configuration
@ImportResource({"classpath:appbase-context.xml"})
public class AppConfig {
// @Bean definitions here...
}
Remember, when you are using Spring's Java Configuration, you need to specify an additional context-param
that says the class to use for your application context:
<context-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</context-param>