简体   繁体   中英

Escaping double quotes inside XML spring config file

I have an SQL Query and i want to put it in the XML spring config File, but i'm getting formatting errors so how can i escape double quotes in this case ?

Here is my 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 !

Thanks in advance !

try this

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM