当前位置: 首页 > news >正文

访问不了/druid/index.html (sql.html 或 login.html)

我是配好了druid连接池的.启动了一个springboot项目然后点击关闭能看到,的确配好了.

目前没有找到能解释我yml文件配了,但是为啥失效的原因.

解决方法: 用java代码方式配置,我把之前的这段配置注释了.

@Configuration
public class DruidConfig {@Beanpublic ServletRegistrationBean<StatViewServlet> druidStatViewServlet() {ServletRegistrationBean<StatViewServlet> registrationBean = new ServletRegistrationBean<>(new StatViewServlet(),  "/druid/*");registrationBean.addInitParameter("allow", "127.0.0.1");// IP白名单 (没有配置或者为空,则允许所有访问)registrationBean.addInitParameter("deny", "");// IP黑名单 (存在共同时,deny优先于allow)registrationBean.addInitParameter("loginUsername", "root");registrationBean.addInitParameter("loginPassword", "1234");registrationBean.addInitParameter("resetEnable", "false");return registrationBean;}
}

相关文章:

  • 自学嵌入式 day26 - 系统编程 文件io 目录操作
  • Insar 相位展开真实的数据集的生成与下载(随机矩阵放大,zernike 仿真包裹相位)
  • 【编译原理】期末
  • 多表连接查询:语法、注意事项与最佳实践
  • Java+Python智能化网盘【Day9-1】
  • 趣味数据结构之——栈
  • 1 Studying《Computer Vision: Algorithms and Applications 2nd Edition》1-5
  • 基于springboot的海产品交易系统
  • AI代码助手实践指南
  • 03.BUG
  • (线性代数)矩阵的奇异值Singular Value
  • 测量 Linux 中进程上下文切换需要的时间
  • python 项目利用uv管理python包依赖
  • 如何在 Ubuntu 上通过终端或在 VirtualBox 中安装 GCC
  • 大事件项目记录11-文章分类接口开发-删除文章分类
  • zookeeper Curator(3):Watch事件监听
  • c++学习(一、指针)
  • 14、ElasticSearch
  • Kioptrix Level1
  • Word之电子章制作——1