Java 动态配置spring';s集成int http:入站网关

Java 动态配置spring';s集成int http:入站网关,java,spring,jetty,spring-integration,Java,Spring,Jetty,Spring Integration,目前,我有一个简单的war,其中包含一些spring集成配置,该war使用以下代码部署到jetty容器中: protected void createWac(File file, ConnectorConfig config) throws Exception, InterruptedException { WebAppContext webapp = new WebAppContext(); webapp.setContextPath("/"); webapp.setW

目前,我有一个简单的war,其中包含一些spring集成配置,该war使用以下代码部署到jetty容器中:

protected void createWac(File file, ConnectorConfig config) throws Exception, InterruptedException {
    WebAppContext webapp = new WebAppContext();
    webapp.setContextPath("/");
    webapp.setWar(file.getAbsolutePath());
    startServer(webapp, inboundConnector.getPort());
}
在Spring集成配置中,我有一个inthttp:inbound网关,如下所示

<!-- External listener definition -->
<int-http:inbound-gateway id="entryHttpInboundGateway"
    request-channel="myRequestChannel"
    path="myPath" 
    reply-channel="myReplyChannel"
    request-payload-type="com.me.MyType"
    supported-methods="POST" message-converters="converters"
    reply-timeout="1000">
</int-http:inbound-gateway>

关于如何解决这个问题,或者如何在war部署到jetty容器之前将值注入war的上下文文件,您有什么想法吗?

您必须在春季查看
环境抽象

并考虑您的应用程序在“代码>属性PrasyStutoHeldObjultDeals/<代码>的情况下的一些钩子,在您的例子中,对于<代码> ServelCoufg < /C> >:

对于通用标准ServletEnvironment,完整的层次结构如下所示,最高优先级的条目位于顶部:*ServletConfig参数(如果适用,例如在DispatcherServlet上下文的情况下)*ServletContext参数(web.xml上下文参数条目)*JNDI环境变量(“java:comp/env/”条目)*JVM系统属性(“-D”命令行参数)*JVM系统环境(操作系统环境变量)

从另一侧考虑迁移到

<!-- External listener definition -->
<int-http:inbound-gateway id="entryHttpInboundGateway"
    request-channel="myRequestChannel"
    path="#{ systemProperties['HTTP_PATH'] }" 
    reply-channel="myReplyChannel"
    request-payload-type="com.me.MyType"
    supported-methods="POST" message-converters="converters"
    reply-timeout="1000">
</int-http:inbound-gateway>
IntegrationRequestMappingHandlerMapping - Mapped "{[/{ systemProperties['HTTP_PATH'] }],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public abstract void org.springframework.web.HttpRequestHandler.handleRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws javax.servlet.ServletException,java.io.IOException