Tuesday, June 6, 2017

With spring, call any java code from applicationcontext.xml via expressions and while creating beans.

I found that arbitrary java can be called with spring from the applicationcontext.xml file.
See these:
https://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html
https://stackoverflow.com/questions/11645477/how-to-store-password-as-encrypted-in-properties-file-in-spring

For example:

<property name="password" value="#{T(blah.myEncryption).decrypt('${whereever.props.are.stored.password}')}" />

No comments:

Post a Comment