Gib*_*tar 5 xml spring-integration spring-el
我需要构建一个动态路径,将属性文件中定义的值与 SpEL 表达式的结果相结合,但找不到正确的语法来实现这一目标。
我的情况是这样的:
<bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:myprop.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="false"/>
</bean>
<bean id="fileNameToFSTree"
class="foo.bar.FileNameToFSTree"/>
<int-file:outbound-channel-adapter id="filesOut"
auto-create-directory="true"
directory-expression="${outDir} + @fileNameToFSTree.nameToTree(payload)"
delete-source-files="true"/>
Run Code Online (Sandbox Code Playgroud)
鉴于该myprop.properties文件包含一个变量outDir,我想在directory-expression文件出站的前面添加该变量。
显然它会定期评估,${outDir}但我得到以下异常:
org.springframework.expression.spel.SpelParseException: Expression [/tmp/output + @fileNameToFSTree.nameToTree(payload)] @0: EL1070E: Problem parsing left operand
Run Code Online (Sandbox Code Playgroud)
我在文档或示例中没有发现这种情况的痕迹。
有什么提示吗?
发布问题后立即找到答案:
基本上,语法是:
directory-expression="'${outDir}' + @fileNameToFSTree.nameToTree(payload)"