1.直接將項目放到webapps目錄下
創建虛目錄hello /hello:項目的訪問路徑
簡化部署:將項目打成一個war包,將war包放置在webapps目錄下.war包會 自動解壓縮
2.配置conf/server.xml文件
在<Host標籤中配置
<Context docBase=“D:\hello” path="/hehe"
docBase:項目存放的路徑
path:虛目錄
3.在conf\catalina\localhost創建任意名稱的xml文件
在文件中編寫<Context docBase=“D:\hello” 標籤
虛目錄:xml文件的名稱
Tomcat圖
Request圖
請求轉發
獲取前端表格輸入的參數