配置server.xml文件,例如我的这个文件在 I:\jboss-4.0.1\server\default\deploy\jbossweb-tomcat50.sar\server.xml
找到Host元素,在这个元素中的最下面加上:
<Context path="/tempdir" docBase="c:\temp" crossContext="true" />
你试试看,我就是这样配置的
有兴趣的话访问一下我的站点:xujin.isme.net ^_^
找到Host元素,在这个元素中的最下面加上:
<Context path="/tempdir" docBase="c:\temp" crossContext="true" />
你试试看,我就是这样配置的
有兴趣的话访问一下我的站点:xujin.isme.net ^_^
<Configure class="org.mortbay.jetty.Server">
<!-- =============================================================== -->
<!-- Configure the Request Listeners -->
<!-- =============================================================== --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Add and configure a HTTP listener to port 8080 -->
<!-- The default port can be changed using: java -Djetty.port=80 -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<Call name="addListener">
<Arg>
<New class="org.mortbay.http.SocketListener">
<Set name="Port"><SystemProperty name="jetty.port" default="8080"/></Set>
<Set name="MinThreads">5</Set>
<Set name="MaxThreads">100</Set>
<Set name="MaxIdleTimeMs">30000</Set>
<Set name="MaxReadTimeMs">60000</Set>
<Set name="MaxStopTimeMs">5000</Set>
<Set name="LowResourcePersistTimeMs">5000</Set>
</New>
</Arg>
</Call>
这个就是设置Jetty服务,在<Call name="addListener">前面加上
<Call name="getContext">
<Arg>/tempdir/*</Arg>
<Set name="ResourceBase">C:/temp</Set>
<Call name="addHandler">
<Arg>
<New class="org.mortbay.http.handler.ResourceHandler">
</New>
</Arg>
</Call>
</Call>
就行了
如访问http://localhost:8080/tempdir/login.jsp,对应的文件就是C:/temp/login.jsp