我想使用Spring集成来设置remoteDirectoryExpression,下面的代码我将它设置为“headers。['remote_dir']”。但是,它显示下面的错误。我如何编写spEl来使其工作?谢谢。春季集成IntegrationFlow DSL for ftp
org.springframework.beans.factory.BeanCreationException:错误创建具有名称豆 'ftpOut' 类路径资源定义[COM/carrotit/CA /配置/ SpringIntegrationFtp.class]:通过工厂方法豆实例失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[org.springframework.integration.dsl.IntegrationFlow]:工厂方法'ftpOut'抛出异常;嵌套异常是org.springframework.expression.spel.SpelParseException:EL1049E:(POS 7): '' 意外的数据之后: 'lsquare([)'
=========== ==代码=====================
@Bean
public IntegrationFlow ftpOut() {
// String remoteDirectory = "/root/sub/subfolder/";
String remoteDirectoryExpression ="headers.['remote_dir']";
return IntegrationFlows.from(messageChannel())
.handle(Ftp.outboundAdapter(sessionFactory(), FileExistsMode.REPLACE).remoteDirectoryExpression(remoteDirectoryExpression)
.autoCreateDirectory(true))
.get();
}
谢谢你加里,删除点后,它的作品。 –