I would like to import different resource files based on some condition. Is this possible?
These don’t work:
<import resource="#{ systemProperties['foo'] }.xml" />
<import resource="#{ T(my.testpkg).getValue() }.xml" />
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SpEL is supported, but Spring resolves the import statement very early on.
When spring is resolving import statements, property placeholders have not yet been resolved.
For example:
Define the following properties:
We can then use the ‘import.fileName’ property as a parameter to the import
This resolves to:
And presumably the resource ‘${blah}’ does not exist.
That being said, you can use properties to resolve import file names.