错误如下:

SpringBoot内置SpringMVC控制器转发到对应的JSP页面报Could not resolve view with name 'xx' in servlet with name dispa

请求:

SpringBoot内置SpringMVC控制器转发到对应的JSP页面报Could not resolve view with name 'xx' in servlet with name dispa

处理方式:

在主启动类中增加一下代码即可解决问题:

 @Bean
public InternalResourceViewResolver setupViewResolver(){
   InternalResourceViewResolver resolver = new InternalResourceViewResolver();
   resolver.setPrefix("/WEB-INF/jsp/");
   resolver.setSuffix(".jsp");
   return resolver;

}

SpringBoot内置SpringMVC控制器转发到对应的JSP页面报Could not resolve view with name 'xx' in servlet with name dispa

参考:https://blog.csdn.net/testcs_dn/article/details/80249894

相关文章:

  • 2022-01-12
  • 2021-11-10
  • 2021-08-28
  • 2022-12-23
  • 2021-12-05
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-07
  • 2021-09-11
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
相关资源
相似解决方案