Jetty 7 在配置webapps的根入口的时候,默认配置并不在/etc/jetty.xml里面
而是在/contexts/xxxxxx.xml 里面, 比如默认的为/contexts/test.xml
打开test.xml里面会有一句:
<Set name="contextPath">/</Set>
这就是一个关键,如果你想改到其他项目,比如说abc项目中
那么你就需要在/contexts/abc.xml 中加入
<Set name="contextPath">/</Set>
并把test.xml里面的修改为
<Set name="contextPath">/testanother</Set>
————————— 华丽的分割线 ———————————
让我们来看看在某一项目的入口页面,例如在 /webapps/abc下面的默认入口页面,则是在 /webapps/abc/WEB-INF/web.xml中定义:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"…………..>
……………………………..
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
……………………………..
</web-app>
在web-app节中间加入这个welcome-file-list便是页面入口.
小技巧,也许还有更好的方法,望指点。

