2013年4月13日 星期六

[筆記] 如何設定 tomcat 的網頁資源路徑 與 顯示歡迎畫面

安裝tomcat的目錄/conf/server.xml
在<Hostname="localhost" debug="0" appBase="webapps"......> </Host>標籤之間添加:
<Context path="A1" docBase="A2" debug="0" reloadable="true" />
A1:不填則輸入ip就顯示A2目錄下的資源;若為/test,則要輸入http://ip:8080/test才可以。
A2:預設為tomcat/webapps/ROOT,也就是網頁資源的路徑。
ex: http://127.0.0.1:8080/haha 取得jsp-examples下的資源。










安裝tomcat的目錄/conf/web.xml
<welcome-file-list>
<welcome-file>A3</welcome-file>
.
.
.
</welcome-file-list>
A3:要當做首頁的html或jsp放最上面




沒有留言:

張貼留言