如何在spring4中配置多个视图解析器以防止它们之间发生冲突?例如:
@Bean
public ViewResolver viewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix(".jsp");
resolver.setExposeContextBeansAsAttributes(true);
return resolver;
}
@Bean
public ViewResolver viewResolver() {
return new TilesViewResolver();
}
互联网上有xml配置的解释,但我还没有看到任何spring4 java配置。
答案 0 :(得分:2)