如何将ViewResolvers从jsp更改为HTML View?

时间:2016-02-16 03:43:16

标签: spring spring-mvc

@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    InternalResourceViewResolver viewResolver = new    InternalResourceViewResolver();
    viewResolver.setViewClass(JstlView.class);
    viewResolver.setPrefix("/WEB-INF/views/");
    viewResolver.setSuffix(".jsp");
    registry.viewResolver(viewResolver);
}

我更改了viewResolver.setSuffix(" .html");现在我收到404错误。

enter image description here

1 个答案:

答案 0 :(得分:0)

我认为问题是viewResolver.setViewClass(JstlView.class);。尝试将其删除并再次测试。