index.htmlcss
<html>html <head>java <title>hello</title>web </head>瀏覽器 <body>tomcat <h1>Hello World!</h1>安全 </body>服務器 </html>app |
web.xmlwebapp
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> </web-app> |
完整的Web應用還須要在WEB-INF目錄下建立:
webapps
- hello
-index.html
-WEB-INF
-web.xml
-classes
-lib
<welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list>
server.xml
![]()
|
1) path:指定當前應用的名稱;
2) docBase:指定應用的物理位置;
3) 瀏覽器訪問路徑:http://localhost:8080/atguigu/index.html。