Druid数据源监控配置

@Configuration
public class DruidConfiguration {
    @Bean
    public ServletRegistrationBean druidServlet(){
        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
        Map initParam = new HashMap();
        initParam.put("loginUsername","admin");
        initParam.put("loginPassword","admin");
        initParam.put("allow","");
        servletRegistrationBean.setInitParameters(initParam);
        return servletRegistrationBean;
    }
}

 

posted @ 2021-06-25 14:36  紫川先生  阅读(77)  评论(0编辑  收藏  举报