Java 使用Spring集成HttpInbound示例
我试图在SpringBoot应用程序中使用Spring集成,以便下载HTTP文件并将其保存到磁盘。 我找不到这样做的例子。 查看文档,我发现:Java 使用Spring集成HttpInbound示例,java,spring,spring-boot,spring-batch,spring-integration,Java,Spring,Spring Boot,Spring Batch,Spring Integration,我试图在SpringBoot应用程序中使用Spring集成,以便下载HTTP文件并将其保存到磁盘。 我找不到这样做的例子。 查看文档,我发现: <bean id="httpInbound" class="org.springframework.integration.http.inbound.HttpRequestHandlingController"> <constructor-arg value="true" /> <!-- indicates that
<bean id="httpInbound"
class="org.springframework.integration.http.inbound.HttpRequestHandlingController">
<constructor-arg value="true" /> <!-- indicates that a reply is expected -->
<property name="requestChannel" ref="httpRequestChannel" />
<property name="replyChannel" ref="httpReplyChannel" />
<property name="viewName" value="jsonView" />
<property name="supportedMethodNames" >
<list>
<value>GET</value>
<value>DELETE</value>
</list>
</property>
</bean>
收到
删去
仍然不知道如何连接所有的点。我发送URL路径的动态性如何
我只找到了http出站示例
情况非常简单。只需通过通道发送一个要下载的文件路径即可
有实际的例子吗?
谢谢。此示例将帮助您:
是的,它没有启动,但没有区别:只需使用
spring Boot starter web将启动插件添加到Gradle中,您的应用程序将是带有嵌入式Tomcat的web应用程序。我注意到您使用了那里的web.xml。在我的spring boot应用程序中,我没有使用web.xml。我将如何添加servlet?Spring Boot会为您这样做-默认的DispatcherServlet
。您只需要为
指定所需的路径。