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 = &#10; 

gives : foo&#10;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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -