Remove FreeMarker/Velocity/TilesConfigurer MVC config
After some further discussion: The MVC config simplifies ViewResolver configuration especially where content negotiation view resolution is involved. The configuration of the underlying view technology however is kept completely separate. In the case of the MVC namespace, dedicated top-level freemarker, velocity, and tiles namespace elements are provided. In the case of the MVC Java config, applications simply declare FreeMarkerConfigurer, VelocityConfigurer, or TilesConfigurer beans respectively. Issue: SPR-7093
This commit is contained in:
@@ -51,7 +51,7 @@ import static org.mockito.Mockito.*;
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@WebAppConfiguration("src/test/resources/META-INF/web-resources")
|
||||
@WebAppConfiguration("classpath:META-INF/web-resources")
|
||||
@ContextHierarchy({
|
||||
@ContextConfiguration(classes = RootConfig.class),
|
||||
@ContextConfiguration(classes = WebConfig.class)
|
||||
@@ -100,7 +100,7 @@ public class JavaConfigTests {
|
||||
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
static class WebConfig extends WebMvcConfigurerAdapter implements TilesWebMvcConfigurer {
|
||||
static class WebConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Autowired
|
||||
private RootConfig rootConfig;
|
||||
@@ -130,9 +130,11 @@ public class JavaConfigTests {
|
||||
registry.tiles();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureTiles(TilesConfigurer configurer) {
|
||||
@Bean
|
||||
public TilesConfigurer tilesConfigurer() {
|
||||
TilesConfigurer configurer = new TilesConfigurer();
|
||||
configurer.setDefinitions("/WEB-INF/**/tiles.xml");
|
||||
return configurer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user