Tomcat的簡單Web發布

來源:互聯網
上載者:User

標籤:odi   let   version   lib   java   1.0   ros   host   webapps   

1.在tomcat檔案中的webapps檔案中建立一個檔案夾,名字自取,這裡就用firstWeb來代替

2.在firstWeb檔案中建一個新的檔案夾,名稱必須是WEB-INF

3.在WEB-INF中建立兩個檔案夾,

   {一個是classes,專門用來存放java的類的檔案夾

    第二個lib,專門存放依賴包的檔案夾}

4.在WEB-INF中建立一個web.xml檔案,檔案中留下這些資訊就可以:

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
metadata-complete="true">

 

</web-app>

5.網站的資訊的檔案,比如index.html,暫時放在firstWeb中,不放在WEB-INF中.

6.通過cmd開啟tomcat,然後開啟瀏覽器,輸入網址localhost:8080/firstWeb/index.html,就可以把index中的網站顯示出來,即把網站網址與ip地址對應起來了,其他人可以通過  :(你的ip地址加上8080/firstWeb/index.html)來訪問你的網頁

Tomcat的簡單Web發布

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.