java - Spring Batch property placeholder endline -
i facing problem while trying store end line separator in java properties file in order import xml configuration file.
with following xml :
<bean id="foowriter" class="org.springframework.batch.item.file.flatfileitemwriter"> <property name="resource" value="file:${myjob.file.output}" /> <property name="lineseparator" value="${myjob.file.lineseparator}" /> </bean>
the following property entry :
myjob.file.lineseparator =
gives : foo
bar
myjob.file.lineseparator = \n
gives : foobar(nothing)
myjob.file.lineseparator = \\n
gives : foo\nbar
myjob.file.lineseparator = '\n' or "\n"
gives :
foo' or foo" 'bar or "bar
it seems it's working quotes remains.
any solution externalize endline separator ?
it work me spring 4 ,
a properties file containing
lineseparator=\n
spring configuration
<context:property-placeholder location="classpath:meta-inf/spring/my.properties"/>
spring batch configuration (removed file path config)
<bean id="itemwriter" class="org.springframework.batch.item.file.flatfileitemwriter" scope="step" > <property name="lineseparator" value="${lineseparator}" /> </bean>
Comments
Post a Comment