SpringBoot代码方式禁用Druid Monitor

2021-07-31 07:56

阅读:854

标签:str   rgba   druid   项目   turn   代码   false   Servle   led   第一种方式: @Configuration public class DruidConfig { @Bean public ServletRegistrationBean druidServlet() { ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(); servletRegistrationBean.setServlet(new StatViewServlet()); servletRegistrationBean.setEnabled(false); return servletRegistrationBean; } } 第二种方式 启动类上加排除servlet,老项目担心影响别的功能,慎用 @SpringBootApplication(exclude = { DispatcherServletAutoConfiguration.class })  SpringBoot代码方式禁用Druid Monitor标签:str   rgba   druid   项目   turn   代码   false   Servle   led   原文地址:https://www.cnblogs.com/hujiapeng/p/14962110.html


评论


亲,登录后才可以留言!