使用低优先级View(jsp)的同时引入高优先级View(velocity or freemarker)的包会造成mvc先找模版文件,并伴随error log。
@Bean
public ViewResolver viewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/jsp/");
resolver.setSuffix(".jsp");
//设置JSP优先级,不然会先找模版
resolver.setOrder(0);
return resolver;
}
网友评论