国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

如何設置Tomcat默認主頁(指定歡迎頁)?

2019-11-17 04:14:56
字體:
來源:轉載
供稿:網友

方法一:(適合對服務器中單個站點的設置)
(d:/demo/為站點根目錄)
在Tomcat中,默認主頁為:index.html,index.htm,index.jsp
如果需要使用其他頁面作為默認主頁,需要配置WEB-INF文件夾下的web.xml文件:
如上例中:
在D:/demo/WEB-INF/文件夾中建立文件web.xml:
內容如下:


<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app version=”2.4″
xmlns=”http://java.sun.com/xml/ns/j2ee”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd“>
<welcome-file-list>
<welcome-file>hello.jsp</welcome-file>
</welcome-file-list>
</web-app>

方法二:(以下設置將應用于該服務器下所有的站點)推薦使用
打開文件conf/web.xml,找到這段代碼:

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

在中間加入你想要的文件名即可。
如:我想讓hello.jsp成為默認首頁,我將上面那段代碼改成:

<welcome-file-list>
<welcome-file>hello.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 白水县| 营口市| 民和| 黎城县| 通海县| 邢台市| 金门县| 云阳县| 吴川市| 深水埗区| 托克逊县| 万载县| 大连市| 缙云县| 勐海县| 富裕县| 铜川市| 启东市| 新野县| 凤翔县| 个旧市| 晴隆县| 平利县| 永宁县| 腾冲县| 奈曼旗| 景谷| 邹平县| 盱眙县| 荃湾区| 颍上县| 贡觉县| 仙居县| 隆子县| 泊头市| 北安市| 天镇县| 中卫市| 嘉禾县| 英山县| 璧山县|