国产探花免费观看_亚洲丰满少妇自慰呻吟_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>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 大方县| 浦县| 朔州市| 宣恩县| 井冈山市| 阜平县| 永新县| 渭南市| 阳高县| 塘沽区| 汉源县| 锡林郭勒盟| 慈溪市| 孝昌县| 朝阳区| 汉沽区| 汉阴县| 望江县| 武邑县| 甘肃省| 贺州市| 西峡县| 金溪县| 锦州市| 邢台县| 河西区| 利川市| 日土县| 黄龙县| 仙游县| 嘉祥县| 白水县| 泗阳县| 嘉定区| 海林市| 海城市| 蓝山县| 乐亭县| 英德市| 开原市| 奉贤区|