Jetty 9 actual combat installation operation deployment.

When I first came into contact with jetty, I searched for information on the Internet. Many of them introduced version 1.6. However, The later versions after 1.7 are quite different from the previous ones. I also wrote an article on the operation of jetty6. However, when I wanted to write a demo about servlet, there was a problem, and the information on the Internet could not run on this machine. ,发现jar包的引用也不一样,所以我在这里我写写如何安装最新的jetty9.X 
 
6.0之前引用的jar包名称是 import org.mortbay.jetty.Server;
The name of the jar package quoted after 7.0 is import org.eclipse.jetty.server.Server; (jetty was acquired by eclipse)

Download from http://download.eclipse.org/jetty/updates/jetty -bundles-9.x/

The article is excerpted to http://blog.csdn.net/kongxx/article/details/7218767

1. Firstly from Jetty’s official website http:/ /wiki.eclipse.org/Jetty/Starting/Downloads download the latest Jetty, there are two versions 7.x and 8.x, 7.x is running on JDK5 and above, 8.x, 9.x is running In JDK6 and above, I chose version 8.0.4 here.
2. 解压压缩包到指定目录,且将其目录路径定义为${JETTY_HOME}
 
3. 启动Jetty服务
    3.1 进入${JETTY_HOME}目录,然后运行“java – jar start.jar”, you can start Jetty server
3.2 Open the browser, visit http://localhost:8080, and you can see the Jetty welcome page.
 
4. Jetty配置
    4.1 Jetty的配置文件都是放在${JETTY_HOME}/etc目录下;
    4.2 通过${JETTY_HOME}/etc/jetty-webapps.xml文件, It can be seen that all web apps are placed in the ${JETTY_HOME}/webapps directory by default in Jetty; (Note: the 9.x version is ${JETTY_HOME}/etc/webdefault.xml)
4.3 In the Jetty package A test.war application is included by default in the .You can find this file in the ${JETTY_HOME}/webapps directory. The test.war application has been deployed by default when the Jetty service is started. For the test.war file, Jetty also defines the context file, which is placed in ${JETTY_HOME}/contexts/test.xml, where the contextPath is defined as “/”, which is why http://localhost:8080/ is accessed by default Why is it time to access the test application.

5 部署新的web应用程序
    5.1 对于war包的部署,只需要将war文件放到${JETTY_HOME}/webapps目录下,然后就可以通过浏览器直接访问了;
5.2 For the deployment of the web application directory, at this time you can copy the web application directory to the ${JETTY_HOME}/webapps/ directory, and then in ${JETTY_HOME}/contexts/. xml文件,其中内容如下:
 

   /myapp /webapps /myapp 

Restart the Jetty service and visit http://localhost:8080/myapp to see the newly deployed web application. Jetty-bundles-repository-9.0.5.v20130815.zip (7.5 MB)

When I first came into contact with Jetty, I found information on the Internet. Many of them introduced version 1.6 , However, the later versions after 1.7 are quite different from the previous ones. I also wrote an article on the operation of jetty6. However, I had a problem when I wanted to write a demo about servlet. The information on the Internet is on this machine.运行不了,发现jar包的引用也不一样,所以我在这里我写写如何安装最新的jetty9.X 
 
6.0之前引用的jar包名称是 import org.mortbay.jetty.Server;< br> 7.0之后引用的jar包名称是 import org.eclipse.jetty.server.Server;(jetty被eclipse收购了)
 
从网上下载http://download.eclipse.org/jetty/updates /jetty-bundles-9.x/
 
文章摘抄至http://blog.csdn.net/kongxx/article/details/7218767
 
1. 首先从Jetty的官方网站http ://wiki.eclipse.org/Jetty/Starting/Downloads download the latest Jetty, there are two versions 7.x and 8.x, 7.x is running on JDK5 and above, 8.x, 9.x It runs on JDK6 and above, here I chose version 8.0.4.
2. 解压压缩包到指定目录,且将其目录路径定义为${JETTY_HOME}
 
3. 启动Jetty服务
    3.1 进入${JETTY_HOME}目录,然后运行“java – jar start.jar”, you can start Jetty server
3.2 Open the browser, visit http://localhost:8080, and you can see the Jetty welcome page.
 
4. Jetty配置
    4.1 Jetty的配置文件都是放在${JETTY_HOME}/etc目录下;
    4.2 通过${JETTY_HOME}/etc/jetty-webapps.xml文件, It can be seen that all web apps are placed in the ${JETTY_HOME}/webapps directory by default in Jetty; (Note: the 9.x version is ${JETTY_HOME}/etc/webdefault.xml)
4.3 In the Jetty package A test.war application is included by default in the .You can find this file in the ${JETTY_HOME}/webapps directory. The test.war application has been deployed by default when the Jetty service is started. For the test.war file, Jetty also defines the context file, which is placed in ${JETTY_HOME}/contexts/test.xml, where the contextPath is defined as “/”, which is why http://localhost:8080/ is accessed by default Why is it time to access the test application.

5 部署新的web应用程序
    5.1 对于war包的部署,只需要将war文件放到${JETTY_HOME}/webapps目录下,然后就可以通过浏览器直接访问了;
5.2 For the deployment of the web application directory, at this time you can copy the web application directory to the ${JETTY_HOME}/webapps/ directory, and then in ${JETTY_HOME}/contexts/. xml文件,其中内容如下:
 

   /myapp /webapps /myapp 

Restart the Jetty service and visit http://localhost:8080/myapp to see the newly deployed web application. Jetty-bundles-repository-9.0.5.v20130815.zip (7.5 MB)

Leave a Comment

Your email address will not be published.