我在Spring-Integration中有以下xslt-transformer。如何使用Java Config进行相同的配置?
os.path
答案 0 :(得分:2)
contains(.,'Matched to full address')
从另一方面考虑使用Spring Integration Java DSL,在那里我会更简单:
@Transformer(inputChannel = "input", outputChannel = "output")
@Bean
public XsltPayloadTransformer transformer() {
return new XsltPayloadTransformer(new ClassPathResource("classpath:/test.xsl"),
resultToDoc());
}
答案 1 :(得分:1)
@ServiceActivator(inputChannel="input")
@Bean
public MessageHandler xsltt() {
MessageTransformingHandler handler = new MessageTransformingHandler(transformer());
handler.setOutputChannelName("output");
return handler;
}
@Bean
public Transformer transformer() {
return new XsltPayloadTransformer(new ClassPathResource("classpath:/test.xsl"),
resultToDoc());
}