参考: http://blog.chenlb.com/2009/01/quick-start-jetty-and-embed-in-project.html
1、建立一个简单的web项目 testserver
2、进入jetty的contets目录,复制test.xml 并改名为testserver.xml
更改并且删除一些配置之后如下:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!-- ==================================================================
Configure and deploy the test web application in $(jetty.home)/webapps/test
Note. If this file did not exist or used a context path other that /test
then the default configuration of jetty.xml would discover the test
webapplication with a WebAppDeployer. By specifying a context in this
directory, additional configuration may be specified and hot deployments
detected.
===================================================================== -->
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Required minimal context configuration : -->
<!-- + contextPath -->
<!-- + war OR resourceBase -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Set name="contextPath">/testserver</Set>
<Set name="war">D:/liweiw/workspace/testserver/WebRoot</Set>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Optional context configuration -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Set name="extractWAR">false</Set>
<Set name="copyWebDir">false</Set>
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
</Configure>
4、cmd转到jetty下 并且运行 java -jar start.jar 启动.
分享到:
相关推荐
Intellij IDEA下建立maven管理的web项目,配置jetty热部署
eclipse + maven多模块项目框架 + jetty热部署的实例源码 让你掌握maven中那些令人迷惑的一堆配置,基于此框架快速搭建maven多模块项目完美环境。
Eclipse3.6与m2eclipse,run-jetty-run插件对WEB项目进行热部署以及在jar源码中进行调试
maven的项目用jetty 服务器启动项目时配置此段配置,就可以实现热部署(意思就是eclipse改了代码可以不用重启服务器)
【推荐】Javarebel解决jetty热部署
NULL 博文链接:https://jiasky.iteye.com/blog/1010948
应网友要求,重新整理原《eclipse + maven多模块项目框架 + jetty热部署的实例源码》,增加了各配置的详细注释。 并且基于Spring MVC提供了一个完整功能:实现了生成验证码图片,以及验证输入是否匹配的两个接口,...
JettY 部署Web应用程序.doc
Eclipse与Jetty服务器集成的最简单方法
jetty是什么 jetty配置 jetty使用 jetty嵌入 jetty启动 jetty部署 jetty教程 jetty嵌入式 jetty
jetty修改js不用重启项目的方法,你还在愁每次修改js后,都需要重启jetty吗?看完此文档,再也不用愁了,里面有图有真相,动手操作,让你受益匪浅
Android-I-Jetty服务器部署例子代码,第一运行起来I-Jetty服务器以后,一定想要例子测试一下;
Jersey+Jetty框架简单搭建(包含文件上传下载)
jetty简单启动web服务
详解介绍Eclipse+maven+jetty环境配置
* contexts 热部署目录 * etc jetty配置文件目录 * examples jetty示例 * extras jetty可选扩展 * lib 包含jetty所需的jar文件 * LICENSES 就是LICENSES * modules 子模块 * patches 补丁patches * pom.xml is jetty...
NULL 博文链接:https://xj84.iteye.com/blog/1177979
jetty-security-9.4.8.v20171121.jar,jetty-io-9.4.8.v20171121.jar,jetty-continuation-9.4.8.v20171121.jar,jetty-client-9.4.8.v20171121.jar,jetty-jmx-9.4.8.v20171121.jar,jetty-plus-9.4.8.v20171121....
myeclipse中jetty和svn检出的插件,包括使用说明等,也可以私聊我,发资源。
简单jetty配置