Java web App 部署静态文件

以 Tomcat 为例子,静态文件,如 html, css, js ,无需编译,所以只需要把文件复制到 Tomcat/webapps 目录下面某个子目录,便可以了。

例子:

1. 在 Tomcat/webapps 目录下,新增文件夹 tt

2. 在 tt 文件夹中新增文件 test.html

3. 启动 Tomcat ,使得能访问 localhost:8080

此时,通过浏览器访问 http://localhost:8080/tt/test.html 就可访问到新增的 test.html 文件。

原文地址:https://www.cnblogs.com/TonyYPZhang/p/5247958.html