将context.xml从Tomcat转换为Jetty

我在webapp / meta-inf /中有以下context.xml.
tomcat使用这个来定义 Spring将使用Property理解的值

<?xml version="1.0" encoding="UTF-8"?>
<Context>     
<Parameter name="si.host" value="super.com"  override="false"/>   
</Context>

现在我试图使用maven jetty插件部署webapp:

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
    <version>6.1.26</version>
    <configuration>
      <connectors>
        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
          <port>8080</port>
          <maxIdleTime>60000</maxIdleTime>
        </connector>
      </connectors>
      <jettyEnvXml>${basedir}\src\test\resources\server\jetty\jetty-env.xml</jettyEnvXml>
      <jettyConfig>${basedir}\src\test\resources\server\jetty\jetty.xml</jettyConfig > 
       <contextpath>/myapp</contextpath>
      <webApp>target/myapp.war</webApp>
      <stopKey>foo</stopKey>
      <stopPort>9999</stopPort>
    </configuration>
    <executions>
      <execution>
        <id>start-jetty</id>
        <phase>pre-integration-test</phase>
        <goals>
          <goal>run</goal>
        </goals>
        <configuration>
          <scanIntervalSeconds>0</scanIntervalSeconds>
          <daemon>true</daemon>
        </configuration>
      </execution>
      <execution>
        <id>stop-jetty</id>
        <phase>post-integration-test</phase>
        <goals>
          <goal>stop</goal>
        </goals>
      </execution>
    </executions>        
  </plugin>

如何在jetty.xml文件添加此参数?
我已经深入研究了他们的文档,这里和谷歌,但没有发现任何明确的.
在此先感谢您的帮助.

解决方法

这需要进入你的WEB-INF / web.xml,这是独立于web服务器的,即它可以在tomcat和jetty中工作:

<context-param>
  <param-name>si.host</param-name>
  <param-value>super.com</param-value>
</context-param>

或者你可以在你的jetty xml中设置它像这样:

<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  ...
  <Set name="initParams">
    <Map>
      <Entry>
        <Item>si.host</Item>
        <Item>super.com</Item>
      </Entry>
    </Map>
  </Set>
</Configure>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念