Tomcat 代码仓库
完整的 Apache Tomcat 教学,请跳转此链接“史上最友好的服务器 Tomcat 搭建小白入门”
欢迎来到 Tomcat 的工具类-——代码仓库
项目结构
Maven 配置文件
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>webdemo</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>webdemo Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>webdemo</finalName>
<plugins>
<plugin>
<!--这里是插件信息,第一次使用 maven 会从中央仓库下载-->
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<!-- 设置服务器的端口信息,默认是8080-->
<port>80</port>
<!-- 设置虚拟路径 -->
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>
</project>
hello.html
<html>
<title>hello</title>
<body>
hello,world
</body>
</html>