eclips如何安装jetty插件

转载自http://www.cnblogs.com/nightswatch/p/4639687.html的博文

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》进入配置,其它完全一样,启动后,即可设置断点进行配置。 
----------------- 
若想通过maven来启动jetty,见我的上一篇文章:

http://www.cnblogs.com/nightswatch/p/4639664.html

时间: 2024-10-29 22:17:27

eclips如何安装jetty插件的相关文章

Eclipse安装Jetty插件

通过Eclipse MarketPlace安装Jetty插件. Jetty下载 1.  2.3.4.5. 注:在使用Jetty的时候,同一个Project中,不可以同时存在两个版本的库,否则会出现找不到jar的情况.或者运行异常.而且,如果高版本和低版本同时存在,高版本会影响低版本. 这一点,千万小心.

eclipse中安装jetty插件并使用

一.eclipse中jetty插件安装: 打开eclipse,依次点击菜单Help->Eclipse Marketplace,在Find后面的框中输入jetty,选择第一项进行install即可. 二.jetty插件的使用: 安装成功后可能要重启eclipse: 然后开始配置: Run>run configurations> 在Jetty Webapp>右键>new,Browser想要启动的项目,配置端口号(我配的是8080),Arguments需要指向一个jetty.xml

为eclipse安装jetty插件

1.安装 打开eclipse->help->install new software弹出窗口 在work with输入地址:http://jettylauncher.sourceforge.net/updates 点击add按钮 下面列表出现jetty安装,选中jetty,next去安装 2.配置使用 在eclipse的maven项目中使用 在pom.xml配置文件里加上 <build> <plugins> <plugin> <groupId>o

Eclipse与jetty插件(Jetty Launcher插件)的安装和使用(一)

http://blog.csdn.net/java20100406/article/details/6108419 Maven的插件集合: 版本描述:Eclipse 3.6(eclipse-jee-helios-win32)  Jetty Launcher插件 下载安装eclipse过程不做描述了. 启动eclipse,Help-> Install New Software,如图: 出现Available Software 界面,选择Add,我们需要新建立jetty的插件(Jetty Launc

Myeclipse10 安装Aptana插件

安装步骤: 1.下载aptana3.2 Eclipse Plugin插件. 下载地址:http://update1.aptana.org/studio/3.2/024747/index.html 2.在java文件夹下新建文件夹pluginsNew,在里面新建aptana_update_024747文件夹(这个文件夹名根据自己下载的版本自己写),再在里面新建eclipse文件夹,解压出features与plugins文件夹,COPY到 D:\java\pluginsNew\aptana_upda

[置顶] Spring Boot系列教程一:Eclipse安装spring-tool-suite插件

一.前言 一直使用eclipse,个人习惯选用Eclipse+spring-tool-suite进行开发,特别注意Eclipse要选用对应的spring-tool-suite进行安装,这点笔者浪费了好长时间,以下为对应的版本. eclipse-kepler.4.3.1–>springsource-tool-suite-RELEASE-e4.3.1-updatesite.zip eclipse-Mars.4.5.1–>springsource-tool-suite-3.7.2RELEASE-e4

在 eclipse 上安装 genymotion 插件不成功后的解决办法(谁弄到装不了,你懂的)

之前按照网上的教程去安装 genymotion 插件,发现安装不了,试了很多次也就成功了一次,但是安装成功的 eclipse 有问题,所以就删除了:悲剧就这么产生了,之后就一直都没有成功过.谁让下个插件都会这样,这里不解释...(此处省略10000个字),如图: genymotion 是一个很不错的软件,跟谷歌官方的模拟器最大的区别就是它的启动速度特别快,而且模拟器的交互也做得挺好的,所以这个软件是做 Android 开发的一个不可或缺的软件,下面来说一下具体安装过程吧.      第一步:点开

IE无法安装HP-QC插件

1.1. IE7.IE8无法正常加载相关控件,导致QC无法使用 目前主要发现情况是IE7或IE8的安全设置级别过高,导致QC控件无法被自动加载,解决办法为添加QC访问地址到受信任站点,并允许ActiveX控件的加载,操作如下: 打开IE8浏览器 >点击"internet选项" >添加QC地址到受信任站点 >更改受信任站点的安全级别设置 ActiveX控件自动提示--允许 未标记为安全的ActiveX控件初始化和脚本运行--允许或提示 下载未签名的ActiveX控件--

Eclipse安装Propedit插件、SVN插件、js插件

1.在线安装Propedit 打开Eclipse的在线安装界面,点击Add Name: propedit Location:http://propedit.sourceforge.jp/eclipse/updates/ 2.在线安装Subclipse Name: subclipse 1.6.x Location:http://subclipse.tigris.org/update_1.6.x 安装完成即可使用. 3.安装包安装 下载spket-1.6.23,解开压缩包以后,把最里面的featur