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; } }