我遇到该问题是直接运行pom.xml(Maven)时,输入命令tomcat:run时出现的,
故打包使用Tomcat7(我用的Tomcat7,其他版本没有试过)解决之。
运行jetty:run命令时当然需要在pom.xml中配置Jetty插件:
pom.xml中配置jetty
jetty.xml
故打包使用Tomcat7(我用的Tomcat7,其他版本没有试过)解决之。
运行jetty:run命令时当然需要在pom.xml中配置Jetty插件:
pom.xml中配置jetty
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<contextPath>/</contextPath>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>720000</maxIdleTime>
</connector>
</connectors>
<!--这一句可以对jetty进一步配置<jettyConfig>src/main/config/jetty.xml</jettyConfig>-->
</configuration>
</plugin>
...
jetty.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure id="Server" class="org.mortbay.jetty.Server">
<!-- Uncomment to limit available threads -->
<!-- Allow an extra thread for Jetty itself, plus one for each Connector -->
<Set name="ThreadPool">
<New class="org.mortbay.thread.BoundedThreadPool">
<Set name="minThreads">3</Set>
<Set name="lowThreads">0</Set>
<Set name="maxThreads">3</Set>
</New>
</Set>
</Configure>