We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本: com.alibaba.boot nacos-config-spring-boot-starter 0.2.8
问题: 使用properties类型文件作为springboot的启动配置, 配置 :test.password=123$456 使用:
test.password=123$456
@NacosValue(value = "${test.password:}", autoRefreshed = true) public void setPassword(String password) { System.out.println(password); }
项目启动的时候无法读取到123$456这个值
使用转义符: test.password=123\$456 项目启动后能读取到test.password=123$456 但是,更新nacos 配置的时候,无法做到自动刷新, 需要更改成配置test.password=123\\$456才能正常读取到test.password=123$456
test.password=123\$456
test.password=123\\$456
通过源码跟踪发现,第一次启动和后续自动刷新时进入的方法不同
class:NacosValueAnnotationBeanPostProcessor
private Object resolveNotifyValue(String nacosValueExpr, String key, String newValue) { String spelExpr = nacosValueExpr.replaceAll("\\$\\{" + key + "}", newValue); return this.resolveStringValue(spelExpr); } private Object resolveStringValue(String strVal) { String value = this.beanFactory.resolveEmbeddedValue(strVal); return this.exprResolver != null && value != null ? this.exprResolver.evaluate(value, this.exprContext) : value; }
有何解决方法,求助!
The text was updated successfully, but these errors were encountered:
issue提错项目了,在nacos-spring-project中,有hxd提过了:nacos-group/nacos-spring-project#293
Sorry, something went wrong.
No branches or pull requests
版本:
com.alibaba.boot
nacos-config-spring-boot-starter
0.2.8
问题:
使用properties类型文件作为springboot的启动配置,
配置 :
test.password=123$456
使用:
项目启动的时候无法读取到123$456这个值
使用转义符:
test.password=123\$456
项目启动后能读取到
test.password=123$456
但是,更新nacos 配置的时候,无法做到自动刷新,
需要更改成配置
test.password=123\\$456
才能正常读取到test.password=123$456
通过源码跟踪发现,第一次启动和后续自动刷新时进入的方法不同
class:NacosValueAnnotationBeanPostProcessor
有何解决方法,求助!
The text was updated successfully, but these errors were encountered: