1. 程式人生 > >tomcat、weblogic上不用專案名,直接通過ip+埠訪問。

tomcat、weblogic上不用專案名,直接通過ip+埠訪問。

weblogic在 專案路徑裡: 專案\WebRoot\WEB-INF\下,新建weblogic.xml,內容為:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">

<weblogic-web-app>
  <context-root>/</context-root>
</weblogic-web-app>


tomcat有兩種方法:
1.進入tomcat伺服器的路徑, D:\Program Files\apache-tomcat-6.0.26\webapps, 將專案名改為ROOT
2.無需修改專案名,開啟 D:\Program Files\apache-tomcat-6.0.26\conf\server.xml,搜尋<host>標籤, 往裡面新增<Context docBase="MyProject" path="" debug="0"  reloadable="true"/>,此時專案名為 MyProject 就可以在瀏覽器中省略專案名去訪問了。