当访问不存在的页面时报错:

springboot关闭whitelabel Error page

 

 

 如何关闭它?有2种方法,

方法1:

application.properties中加入server.error.whitelabel.enabled=false

方法2:在MyApplication上边的注解@SpringBootApplication中加入:exclude = ErrorMvcAutoConfiguration.class,即:

@SpringBootApplication(exclude = ErrorMvcAutoConfiguration.class)

 

当访问不存在资源时,

方法1返回:

springboot关闭whitelabel Error page

 

 

方法2返回:

springboot关闭whitelabel Error page

 

相关文章:

  • 2021-07-17
  • 2021-11-01
  • 2021-10-15
  • 2021-05-20
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2021-11-22
  • 2021-04-30
相关资源
相似解决方案