0

I work with Spring Batch and want to make a dynamic placeholder, which will take a value from properties file depending on input param.

So I have and I can access:

#{jobParameters['fileExtension']}
${file.ext.csv}

and I want to make something like: ${file.ext.#{jobParameters['fileExtension']}

Any ideas how to implement this? Thank you for any help!

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
xsiraul
  • 414
  • 1
  • 5
  • 16
  • Try this `#{@myProps['file.ext.' + jobParameters['fileExtension']]}`, where `myProps` is a `Properties` bean for your placeholders – Artem Bilan May 23 '14 at 08:19

1 Answers1

0

Spring nested expression is not yet supported.

See JIRA

https://jira.spring.io/browse/SPR-9590

In a similar situation, I attached a tasklet to the flow and generated the filename on the fly and added the filename to an attribute in jobExecution context. Then refer the complete filename from jobExecution context in your writer.

Kalyan
  • 1,781
  • 11
  • 15
  • It doesn't work. IllegalArgumentException: Could not resolve placeholder 'file.ext.' in string value '${file.ext.}#{'csv'}' – xsiraul May 23 '14 at 08:10