posts - 122,  comments - 25,  trackbacks - 0
          Jetty 當(dāng)前版本為6.1.x,支持servlet2.5、jsp 2.1/2.0。(http://docs.codehaus.org/display/JETTY)

          jetty主要的jar為jetty-6.1.1.jar,servlet-api-2.5-6.1.1.jar,jetty-util- 6.1.1.jar。啟動(dòng)的jar 為start.jar。還有jsp規(guī)范的jar。jsp2.1,好像已經(jīng)減了不少的jar了,只有4個(gè)文件core-3.1.1.jar,ant- 1.6.5.jar,jsp-2.1.jar,jsp-api-2.1.jar。core是使用eclipse的jdt,進(jìn)行jsp編譯。

          jetty的主要配置文件為etc/jetty.xml,當(dāng)然你可以自己指定別的文件。在start.jar中有個(gè)start.config文件是默認(rèn)的環(huán)境配置,以及指定默認(rèn)的配置文件。可以手工替換。

              啟動(dòng)jetty很簡單,在命令行下面java -jar start.jar;如果需要指定start.config,使用java -DSTART=start.config -jar start.jart;配置web 應(yīng)用也非常的簡單:更改jetty.xml就行了,增加web應(yīng)用的方式包括,直接放置應(yīng)用在webapps下面,或者配置以下的context

          配置Virtual hosts:
          <New class="org.mortbay.jetty.webapp.WebAppContext">
                
          <Arg><Ref id="contexts"/></Arg>
                
          <Arg><SystemProperty name="jetty.home">/webapps/xxx.war</Arg>
                
          <Arg>/xxx</Arg>
                
          <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
                
          <Set name="VirtualHosts">
                  
          <Array type="java.lang.String">
                    <Item>127.0.0.1</Item>
                    
          <Item>www.sample.com</Item>
                    
          <Item>www.sample.net</Item>
                    
          <Item>www.sample.org</Item>
                  
          </Array>
                
          </Set>
          </New>

          context配置($JETTY-HOME/contexts/javadoc.xml):
          <Configure class="org.mortbay.jetty.servlet.Context">
            
          <Set name="contextPath">/javadoc</Set>
            
          <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/javadoc/</Set>
            
          <Call name="addServlet">
              
          <Arg>org.mortbay.jetty.servlet.DefaultServlet</Arg>
              
          <Arg>/</Arg>
            
          </Call>
          </Configure>


          默認(rèn)webapp目錄配置:
          <Call name="addLifeCycle">
            
          <Arg>
              
          <New class="org.mortbay.jetty.deployer.WebAppDeployer">
                
          <Set name="contexts"><Ref id="Contexts"/></Set>
                
          <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/webapps</Set>
                
          <Set name="parentLoaderPriority">false</Set>
                
          <Set name="extract">true</Set>
                
          <Set name="allowDuplicates">false</Set>
                
          <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
              
          </New>
            
          </Arg>
          </Call>


          默認(rèn)的web.xml配置文件為webdefault.xml,如果想配置相應(yīng)的web參數(shù),可以更改其應(yīng)用。默認(rèn)的端口為8080,如果想修改,更改:jetty.port屬性
              <Call name="addConnector">
                
          <Arg>
                    
          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
                      
          <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
                      
          <Set name="maxIdleTime">30000</Set>
                      
          <Set name="Acceptors">2</Set>
                      
          <Set name="confidentialPort">8443</Set>
                    
          </New>
                
          </Arg>
              
          </Call>

          更詳細(xì)的配置信息可查詢官網(wǎng)。
          posted on 2008-01-03 13:51 josson 閱讀(1882) 評(píng)論(0)  編輯  收藏 所屬分類: java 開發(fā)
          <2008年1月>
          303112345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          收藏夾

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 行唐县| 中超| 郓城县| 云林县| 牡丹江市| 赤城县| 大英县| 偏关县| 新干县| 阳山县| 曲松县| 连南| 盐山县| 英超| 班玛县| 汉阴县| 汝城县| 肇源县| 繁峙县| 武功县| 九寨沟县| 贵港市| 奉贤区| 新和县| 长汀县| 五原县| 旅游| 阜阳市| 呼和浩特市| 宁河县| 湖口县| 甘孜| 乌海市| 岳阳县| 扎囊县| 申扎县| 西乌珠穆沁旗| 苏尼特右旗| 新乡市| 中江县| 永福县|