Tomcat Notes: Deployment File

This is a personal study notes of Apache Tomcat. Below are main reference material.

  • [1、Tomcat deployment](#1、Tomcat deployment)

1、Tomcat deployment

1.1、Two modes of deployment

We know all apps we want to deploy should be placed in webappsfolder. Assuming predsis the app in the following notes.

we can see it has predsand preds.war.

Actually predsis the unpacked version of preds.war. They have exactly same content.

it reveals that Tomcat support two modes of deployment:

  • packed: The entire app is packed in a war file, like preds.war.
  • unpacked: A normal folder, unpacked version of preds.war.

So you can have only one of them then execute startup.shor startup.batto get app deployed.

We usually choose packed file to deploy. It's for portability: Packed file is only one file. It's easy to copy or transfer unlike a directory to mess around with.

1.2、deployment file structure

1.2.1、Static files

Static files are like .html, .css, .jsp, .jsand so on.

They are under the fisrt level folder. In below example styles.cssand ajax.xhtmlare static files.

You can also create a subdirectory of your own to place static files. It's very common like image files placed under preds.war/assets/images/.

1.2.2、WEB-INF

WEB-INFhas three types of files. They are configuration, complied files defined by developer and archived code.

  • Configuration files: Configuration file are under WEB-INF, like web.xmland faces-config.xmlin this example. Default configuration file is web.xml. You can configure web context, welcome page and so on in this file.

Compiled files defined by developers also are placed in WEB-INF, which are under classfolder.

In this example you can see complied .javafiles which are .classfiles are under classfolder.

1.2.3、META-INF

It only contains a file called MANIFEST.MFwhich is used to record meta data which is description of the whole .warfile like what the .warfile have and where those files are placed.

Basically it used to make sure everything is in the right place. Just know what is used for is ok.

1.2.4、Summary

相关推荐
SL_staff5 分钟前
JVS-APS 实践:用双向反馈闭环打破制造计划孤岛
java·spring cloud·全栈
\光辉岁月/24 分钟前
3.包装类
java·开发语言·包装类
BeiGuTing_code25 分钟前
Java动态数组(一)
java·数据结构·windows
我命由我1234534 分钟前
软件工程概念 - 可插拔性
java·后端·学习·java-ee·系统架构·软件工程·学习方法
木易 士心1 小时前
Java 后端驱动远程手机自动化:ADB + Python + 内网穿透实战全解
java·后端·智能手机·自动化
十年Java程序媛1 小时前
JVM 内存区域与对象内存布局|new 对象底层流程,对象头 MarkWord 详解
java·jvm·spring boot
用户094248568031 小时前
第2章:Windows、WSL2 与 Docker 环境搭建Redis
java·jvm
小物学长1 小时前
HJ212-2017 对接与环境在线监测平台设计:报文、CRC、应答、预警和传输有效率
java
171320330计算机毕设编程1 小时前
计算机毕业设计 基于springboot+vue的在线观鸟视频播放网站 LW PPT
java·大数据·vue.js·spring boot·算法·课程设计
IT枫斗者枫哥1 小时前
JDBC事务实测:操作日志写入失败时,让客户修改一起回滚
java