【问题标题】:How to set jetty.xml fragment bundle property in Karaf如何在 Karaf 中设置 jetty.xml 片段捆绑属性
【发布时间】:2016-03-01 21:53:03
【问题描述】:

我为org.ops4j.pax.web.pax-web-jetty 创建了一个片段主机,其中包含一个jetty.xml 文件,该文件在Karaf 中被完美提取。

这个 jetty.xml 文件包含如下一行:

<Set name="host"><Property name="jetty.ssl.host" deprecated="jetty.host" /></Set>

您能告诉我在哪里设置jetty.ssl.host 以便我可以设置一个值吗?

最好, 杰罗姆

【问题讨论】:

    标签: jetty apache-karaf karaf pax-web


    【解决方案1】:

    Afaik,在当前版本的 pax-web 中是不可能的。

    source 中,XmlConfiguration 没有任何属性集:

    XmlConfiguration configuration = new XmlConfiguration(jettyResource);
    // configuration.configure(m_server);
    Method method = XmlConfiguration.class.getMethod("configure", Object.class);
    method.invoke(configuration, server);
    

    这种属性(&lt;Property ../&gt;)一般使用XmlConfiguration.getProperties()方法设置,这里没有用到。

    您可能应该使用另一种方式来提供外部配置(例如systemProperty,或者在此 jetty.xml 文件中创建您自己的 bean)。

    【讨论】:

      猜你喜欢
      • 2015-06-29
      • 2013-05-24
      • 2014-05-04
      • 1970-01-01
      • 1970-01-01
      • 2021-04-23
      • 2015-05-22
      • 1970-01-01
      • 2012-03-14
      相关资源
      最近更新 更多