mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge pull request #2278 from lihengming/master
Druid Spring Boot Starter > fix bug & update doc
This commit is contained in:
@@ -155,6 +155,16 @@ spring.datasource.druid.filter.wall.config.drop-table-allow=false
|
||||
|
||||
要想使自定义 Filter 配置生效需要将对应 Filter 的 ```enabled``` 设置为 ```true``` ,Druid Spring Boot Starter 默认会启用 StatFilter,你也可以将其 ```enabled``` 设置为 ```false``` 来禁用它。
|
||||
|
||||
## Spring Boot Actuator Endpoints
|
||||
|
||||
可以使用下面配置类启用 endpoint 默认访问地址:`/druid-endpoint`,可以使用 `endpoints.druid.path=` 自定义终端地址
|
||||
|
||||
```endpoints.druid.enabled=true```
|
||||
|
||||
默认需要安全认证才可以访问,可以用下面两种方式之一来禁用安全认证,详情见 Spring Boot 官方文档
|
||||
|
||||
```endpoints.druid.sensitive=false``` 或 ```management.security.enabled=false```
|
||||
|
||||
## IDE 提示支持
|
||||

|
||||
|
||||
|
||||
@@ -149,6 +149,14 @@ Currently, configuration support is provided for the following filters. Please r
|
||||
|
||||
Druid Spring Boot Starter will enable StatFilter by default, and you can also set its enabled to false.,make the Filter configuration take effect and need to set enabled to true.
|
||||
|
||||
## Spring Boot Actuator Endpoints
|
||||
|
||||
```endpoints.druid.enabled=true```
|
||||
|
||||
default endpoint address is : `/druid-endpoint`, can be used `endpoints.druid.path=` to customize it.
|
||||
|
||||
|
||||
|
||||
## IDE Hints
|
||||

|
||||
|
||||
|
||||
+2
-3
@@ -24,6 +24,7 @@ import com.alibaba.druid.filter.logging.Slf4jLogFilter;
|
||||
import com.alibaba.druid.filter.stat.StatFilter;
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.wall.WallFilter;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
|
||||
@@ -49,9 +50,7 @@ class DruidDataSourceWrapper extends DruidDataSource implements InitializingBean
|
||||
if (super.getUrl() == null) {
|
||||
super.setUrl(basicProperties.determineUrl());
|
||||
}
|
||||
if (super.getDriverClassName() == null) {
|
||||
super.setDriverClassName(basicProperties.determineDriverClassName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Autowired(required = false)
|
||||
|
||||
Reference in New Issue
Block a user