[root@linuxidc ~]# cd /usr/local/jetty/webapps/
[root@linuxidc webapps]# mkdir test
[root@linuxidc webapps]# cd test
[root@linuxidc test]# vi test.jsp
<html>
<body>
<h4>simple test</h4>
<%--echo hello world--%>
<%@page language="java"%>
<%="Hello World"%>
</body>
</html>
[root@linuxidc ~]# cd /usr/local/jetty/
[root@linuxidc jetty]# nohup java -jar start.jar & #拖至后台运行。
2016-10-27 21:11:20.290:INFO::main: Logging initialized @653ms
2016-10-27 21:11:20.356:WARN:oejs.HomeBaseWarning:main: This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommended. See documentation at
2016-10-27 21:11:20.636:INFO:oejs.Server:main: jetty-9.2.6.v20141205
2016-10-27 21:11:20.665:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/usr/local/jetty/webapps/] at interval 1
2016-10-27 21:11:21.544:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@166f10ef{/test,file:/usr/local/jetty/webapps/test/,AVAILABLE}{/test}
2016-10-27 21:11:21.571:INFO:oejs.ServerConnector:main: Started ServerConnector@3cb3600d{HTTP/1.1}{0.0.0.0:8080}
2016-10-27 21:11:21.571:INFO:oejs.Server:main: Started @1935ms
或者进去bin目录执行命令./jetty.sh start
如下图:
至此完成了jetty的部署。