注:本文来源于:《eclipse中jetty插件安装

一.eclipse中jetty插件安装:

打开eclipse,依次点击菜单Help->Eclipse Marketplace,在Find后面的框中输入jetty,选择第一项进行install即可。

二.jetty插件的使用:

安装成功后可能要重启eclipse:
然后开始配置:
Run》run configurations》
在Jetty Webapp》右键》new,Browser想要启动的项目,配置端口号(我配的是8080),Arguments需要指向一个jetty.xml文件(这个文件可以从jetty网站上下载到,下面我也会贴出来)

上面的jetty.xml文件如下:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <!-- =============================================================== -->
<!-- Documentation of this file format can be found at: -->
<!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax -->
<!-- -->
<!-- Additional configuration files are available in $JETTY_HOME/etc -->
<!-- and can be mixed in. See start.ini file for the default -->
<!-- configuration files. -->
<!-- -->
<!-- For a description of the configuration mechanism, see the -->
<!-- output of: -->
<!-- java -jar start.jar -? -->
<!-- =============================================================== --> <!-- =============================================================== -->
<!-- Configure a Jetty Server instance with an ID "Server" -->
<!-- Other configuration files may also configure the "Server" -->
<!-- ID, in which case they are adding configuration to the same -->
<!-- instance. If other configuration have a different ID, they -->
<!-- will create and configure another instance of Jetty. -->
<!-- Consult the javadoc of o.e.j.server.Server for all -->
<!-- configuration that may be set here. -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server"> <!-- =========================================================== -->
<!-- Configure the Server Thread Pool. -->
<!-- The server holds a common thread pool which is used by -->
<!-- default as the executor used by all connectors and servlet -->
<!-- dispatches. -->
<!-- -->
<!-- Configuring a fixed thread pool is vital to controlling the -->
<!-- maximal memory footprint of the server and is a key tuning -->
<!-- parameter for tuning. In an application that rarely blocks -->
<!-- then maximal threads may be close to the number of 5*CPUs. -->
<!-- In an application that frequently blocks, then maximal -->
<!-- threads should be set as high as possible given the memory -->
<!-- available. -->
<!-- -->
<!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool -->
<!-- for all configuration that may be set here. -->
<!-- =========================================================== -->
<Arg name="threadpool">
<New id="threadpool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<Arg name="minThreads" type="int">10</Arg>
<Arg name="maxThreads" type="int">200</Arg>
<Arg name="idleTimeout" type="int">60000</Arg>
<Set name="detailedDump">false</Set>
</New>
</Arg> <!-- =========================================================== -->
<!-- Add shared Scheduler instance -->
<!-- =========================================================== -->
<Call name="addBean">
<Arg>
<New class="org.eclipse.jetty.util.thread.ScheduledExecutorScheduler"/>
</Arg>
</Call> <!-- =========================================================== -->
<!-- Http Configuration. -->
<!-- This is a common configuration instance used by all -->
<!-- connectors that can carry HTTP semantics (HTTP, HTTPS, SPDY)-->
<!-- It configures the non wire protocol aspects of the HTTP -->
<!-- semantic. -->
<!-- -->
<!-- This configuration is only defined here and is used by -->
<!-- reference from the jetty-http.xml, jetty-https.xml and -->
<!-- jetty-spdy.xml configuration files which instantiate the -->
<!-- connectors. -->
<!-- -->
<!-- Consult the javadoc of o.e.j.server.HttpConfiguration -->
<!-- for all configuration that may be set here. -->
<!-- =========================================================== -->
<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
<Set name="secureScheme">https</Set>
<Set name="securePort"><Property name="jetty.secure.port" default="8443" /></Set>
<Set name="outputBufferSize">32768</Set>
<Set name="requestHeaderSize">8192</Set>
<Set name="responseHeaderSize">8192</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">false</Set>
<Set name="headerCacheSize">512</Set> <!-- Uncomment to enable handling of X-Forwarded- style headers
<Call name="addCustomizer">
<Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
</Call>
-->
</New> <Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.ServerConnector">
<Arg name="server"><Ref refid="Server" /></Arg>
<Arg name="factories">
<Array type="org.eclipse.jetty.server.ConnectionFactory">
<Item>
<New class="org.eclipse.jetty.server.HttpConnectionFactory">
<Arg name="config"><Ref refid="httpConfig" /></Arg>
</New>
</Item>
</Array>
</Arg>
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="4001" />4001</Set>
<Set name="idleTimeout">30000</Set>
</New>
</Arg>
</Call> <!-- =========================================================== -->
<!-- Set the default handler structure for the Server -->
<!-- A handler collection is used to pass received requests to -->
<!-- both the ContextHandlerCollection, which selects the next -->
<!-- handler by context path and virtual host, and the -->
<!-- DefaultHandler, which handles any requests not handled by -->
<!-- the context handlers. -->
<!-- Other handlers may be added to the "Handlers" collection, -->
<!-- for example the jetty-requestlog.xml file adds the -->
<!-- RequestLogHandler after the default handler -->
<!-- =========================================================== -->
<Set name="handler">
<New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
</Item>
<Item>
<New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
</Item>
</Array>
</Set>
</New>
</Set> <!-- =========================================================== -->
<!-- extra server options -->
<!-- =========================================================== -->
<Set name="stopAtShutdown">true</Set>
<Set name="stopTimeout">5000</Set>
<Set name="dumpAfterStart">false</Set>
<Set name="dumpBeforeStop">false</Set> </Configure>

请注意更改端口号

之后Apply,run,即可快速启动该项目。
通过:http://localhost:8080/demo2/即可访问工程
上述模式,仅是运行模式,还不能debug。
debug与上面唯一的不同就是要由:
Run》debug configurations》进入配置,其它完全一样,启动后,即可设置断点进行配置。

eclipse中jetty插件安装的更多相关文章

  1. eclipse安装插件的方式 三种:links、eclipse中使用插件安装向导安装、直接copy插件到对应的eclipse目录 MyEclipse10安装SVN插件

    myeclipse安装插件 1.直接将插件copy到myeclipse目录下的dropins目录下(没有目录就新建一个),重启,详细参考 MyEclipse使用总结——MyEclipse10安装SVN ...

  2. Eclipse中propedit插件安装(解决property中文问题)

    Eclipse Help--Install New Software... Add... propedit   -- http://propedit.sourceforge.jp/eclipse/up ...

  3. eclipse中gradle插件安装

    help===>install software===>http://download.eclipse.org/buildship/updates/e46/releases/2.x/

  4. eclipse中svn插件的安装

    Svn(Subversion)是近年来崛起的版本管理工具,在当前的开源项目里(J2EE),几乎95%以上的项目都用到了SVN.Subversion项目的初衷是为了替换当年开源社区最为流行的版本控制软件 ...

  5. eclipse中svn插件的安装与使用

    eclipse中svn插件的安装与使用 一.    eclipse中svn插件的安装 eclipse里安装SVN插件,一般来说,有两种方式: 直接下载SVN插件,将其解压到eclipse的对应目录里 ...

  6. eclipse中svn插件的安装和tortoiseSVN的安装

    在项目的开发中一般都需要用到版本控制,其中用的比较多的就是svn(subVersion),svn的使用既可以以插件的形式,也可以以客户端的形式使用.今天就介绍一下eclipse中svn插件的2种安装方 ...

  7. Eclipse Jetty插件安装

    Eclipse Jetty插件安装 使用方法一: 本地资源包插件下载地址:http://pan.baidu.com/s/1sjNP5Id 或者是地址:http://pan.baidu.com/s/1b ...

  8. eclipse maven plugin 插件 安装 和 配置

      离线插件 点击下载离线安装包:eclipse-maven-plugin.zip ( for eclipse helios or higher ) .解压缩到任意目录(如这里的plugins目录): ...

  9. 最详细eclipse汉化插件安装教程

    最详细eclipse汉化插件安装教程(转) 转自:http://blog.csdn.net/dai_zhenliang/article/details/8588576#t4 教程作者:戴振良 本文与& ...

随机推荐

  1. maven 将第三方jar包转成maven的jar包

    转载:https://blog.csdn.net/qq_40644583/article/details/81475135 1.首先你需要准备外部jar包 我的这个jar包现在以及下载解压到桌面 地址 ...

  2. bugku 逆向 take the maze

    看到如果判断正确之后 会生成一个png文件 直接用idc脚本生成: auto v,begin,end,dexbyte; v = fopen("flag.png", "wb ...

  3. odoo 权限问题

    odoo 权限问题 权限组问题 权限组是为了将人员按组划分同一分配权限.权限组的建立是基于每个应用来实现的 建立一个应用的分组(可省略,主要用于创建用户时有选择项) 建立一条record记录model ...

  4. [CF 666E] Forensic Examination

    Description 传送门 Solution 对 \(T[1..m]\) 建立广义后缀自动机,离线,找出代表 \(S[pl,pr]\) 的每个节点,线段树合并. Code #include < ...

  5. zabbix模板化监控

    zabbix模板化监控 1. 实验简述 在zabbix监控中,有很多组的概念,具体有以下几种: 1. 主机和主机组,相同类型/应用的主机,可以归属于同一个主机组 2. item和application ...

  6. 关于java环境变量配置出现javac命令无法运行的解决办法

    昨天一时兴起给电脑刷了机,想着给电脑装个Win10+Linux的双系统, 结果双系统没装好,所有的东西又得重新弄一遍 今天在配置java的时候又出问题了 java,java-version运行成功了, ...

  7. HTML界面多语言切换

    我在做个人网站时考虑到多语言转换的问题,最后在JS文件中将所有文字数据储存然后设置HTML中的class与key属性来达到多语言效果.当然,还有一个别的方法,就是所有有文字内容的div都用不同语言写一 ...

  8. mysql-binlog日志删除

    第一种方法: mysql> show binary logs; 查看mysql bin-log日志,除了这个以外的,其它都可以使用删除. mysql> purge binary logs ...

  9. 【转载】汇编调试程序Debug使用

    https://blog.csdn.net/Notzuonotdied/article/details/70888205

  10. unix域数据报回射程序(不完整)

    一.服务器程序 int main(int argc, char **argv) { int sockfd; struct sockaddr_un servaddr, cliaddr; sockfd = ...