我有一个 SQL 查询,我想把它放在 XML spring 配置文件中, 但是我遇到了格式错误,所以在这种情况下如何转义双引号?
这是我的属性(property):
<authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="select USERNAME as "username",PASSWORD as "password",1 as "enabled" from USER_APP where username = 'a'"
/>
</authentication-provider>
</authentication-manager>
I've tried the \ and it's not working !
提前致谢!
最佳答案
试试这个
<authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="select USERNAME as "username",PASSWORD as "password",1 as "enabled" from USER_APP where username = 'a'"
/>
</authentication-manager>
关于java - 在 XML spring 配置文件中转义双引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18185301/