2013-08-12 43 views
0

我有一個SQL查詢,我想把它放在XML彈簧配置文件, 但我越來越格式化錯誤,所以在這種情況下,我怎麼才能轉義雙引號?在XML彈簧配置文件中轉義雙引號

這裏是我的財產:

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

我試過\和它不工作!

在此先感謝!

回答

5

試試這個

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