小编Oma*_*ada的帖子

将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>
Run Code Online (Sandbox Code Playgroud)

现在我试图使用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>
Run Code Online (Sandbox Code Playgroud)

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

tomcat jetty

4
推荐指数
1
解决办法
8267
查看次数

特定对象列表的内存使用情况

我有一个简单的pojos(一个User类)列表,其中包含大约15个简单字段和1个arrayList.那些代表用户并且可能100或1000个将存储在内存中以避免每次从外部系统检索它们.(我正在使用Ehcache)

我想通过junit测试知道这些用户的K列表使用了多少内存. 我有直觉认为简单的pojo就像那些即使是1000个也不会以任何方式威胁(换言之,小于100 Ko)

在此先感谢您的回复.我非常感谢你的帮助.

java unit-testing memory-management

3
推荐指数
1
解决办法
4120
查看次数

标签 统计

java ×1

jetty ×1

memory-management ×1

tomcat ×1

unit-testing ×1