我正在使用spring integration ftp的出站通道适配器
<int-ftp:outbound-channel-adapter id="ftpOutAdapterAutoCreate"
session-factory="ftpSessionFactory" channel="outChannel"
remote-directory-expression="headers.['remotedir']" charset="UTF-8" />
在我的java代码中,我在标题中设置了远程目录。
org.springframework.integration.Message<File> messageA=
org.springframework.integration.support.MessageBuilder
.withPayload(reqFile).setHeader("remotedir", "/errorOrders").build();
部署
时显示的错误消息org.springframework.expression.spel.SpelParseException: EL1049E:(pos 7):
Unexpected data after '.': 'lsquare([)'
答案 0 :(得分:1)
您引用Map
的元素没有句号(消息标题是Map
)。语法为headers['remotedir']
([
之前没有点)。
另外,如果你的地图密钥中没有.
,你也可以使用headers.remotedir
。