今天本来是想搞个SuperDiamond配置服务器的搭建,看到他使用jetty做web容器,就先来研究下jetty。搞个jetty启动的demo
jetty的启动有三种方式,我这里用main方法直接启动的方式
要解决两个问题:
1.导包要全
<dependency>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>jetty-all-server</artifactId>
<version>8.2.0.v20160908</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>8.2.0.v20160908</version>
</dependency>
导入上面的两包即可,还看到有说这个包跟tomcat的包有冲突,要是用tomcat启动最好包这些包注释了。