在config.xml中的Spring数据源中注入调用方法的结果。

huangapple 未分类评论50阅读模式
英文:

Inject a result of calling a method inside config.xml datasource in spring

问题

database.properties

database.password=AAAAAhhhhhhiiiiii

config.xml

<environments default="development">
    <environment id="development">
        <transactionManager type="JDBC"/>

        <dataSource type="POOLED">
            <property name="driver" value="${database.driver}"/>
            <property name="url" value="${database.url}"/>
            <property name="username" value="${database.username}"/>
            <property name="password" value="#{com.me.portal.rest.security.encryption.PasswordEncryption.decryptPropertyValue('${database.password}')}"/>
            <property name="driver.oracle.net.CONNECT_TIMEOUT" value="${database.connecttimeout}"/>
            <property name="poolMaximumActiveConnections" value="100"/>
        </dataSource>
    </environment>
</environments>

PasswordEncryption is the class that has the decrypt method.But when I send requests to some endpoints, it gives status as 'fail'. Is there something wrong in the way I call the decrypt method inside config.xml.

英文:

I have a spring project and in database.properties the value is encrypted.I have a class to decrypt that value and I am calling that inside config.xml file

database.properties

database.password=AAAAAhhhhhhiiiiii

config.xml

<environments default="development">
    <environment id="development">
        <transactionManager type="JDBC"/>

        <dataSource type="POOLED">
            <property name="driver" value="${database.driver}"/>
            <property name="url" value="${database.url}"/>
            <property name="username" value="${database.username}"/>
            <property name="password" value="#{com.me.portal.rest.security.encryption.PasswordEncryption.decryptPropertyValue('${database.password}')}"/>
            <property name="driver.oracle.net.CONNECT_TIMEOUT" value="${database.connecttimeout}"/>
            <property name="poolMaximumActiveConnections" value="100"/>
        </dataSource>
    </environment>
</environments>

PasswordEncryption is the class that has the decrypt method.But when I send requests to some endpoints it gives status as 'fail'.Is there something wrong in the way I call the decrypt method inside config.xml.

huangapple
  • 本文由 发表于 2020年6月29日 13:45:57
  • 转载请务必保留本文链接:https://java.coder-hub.com/62631965.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定