druid报异常 “sql injection violation, part alway true condition not allow”的解决方案

druid报异常 “sql injection violation, part alway true condition not allow”的解决方案

使用durid连接池组件,执行sql时发现异常如下:Caused by: java.sql.SQLException: sql injection violation, part alway true condition not allow

解决方案:
参数filters: 属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有:
监控统计用的filter:stat 日志用的filter:log4j 防御sql注入的filter:wall。

把 filters配置中 去掉 wall即可。

druid详细参数配置地址:https://github.com/alibaba/druid/wiki/DruidDataSource%E9%85%8D%E7%BD%AE%E5%B1%9E%E6%80%A7%E5%88%97%E8%A1%A8

猜你喜欢

转载自wfj-god-father.iteye.com/blog/2287446