在XML spring配置文件中转义双引号

时间:2013-08-12 11:00:34

标签: java xml spring oracle formatting

我有一个SQL查询,我想把它放在XML spring配置文件中, 但是我遇到了格式化错误,所以在这种情况下我怎么能逃避双引号?

这是我的财产:

<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>
  

我已经尝试了\并且它无法正常工作!

提前致谢!

1 个答案:

答案 0 :(得分:7)

试试这个

<authentication-manager>
       <authentication-provider>
        <jdbc-user-service data-source-ref="dataSource"
           users-by-username-query="select USERNAME as &quot;username&quot;,PASSWORD as &quot;password&quot;,1 as &quot;enabled&quot; from USER_APP where username = 'a'"
        />
</authentication-manager>
相关问题