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

相关推荐
一勺菠萝丶1 分钟前
Java 后端想学 Vue,又想写浏览器插件?
java·前端·vue.js
xie_pin_an1 分钟前
C++ 类和对象全解析:从基础语法到高级特性
java·jvm·c++
Tao____3 分钟前
企业级物联网平台
java·网络·物联网·mqtt·网络协议
山峰哥5 分钟前
数据库工程与SQL调优实战:从原理到案例的深度解析
java·数据库·sql·oracle·性能优化·编辑器
kaico20186 分钟前
远程调用组件openfeign
java·spring cloud
SunnyDays10116 分钟前
如何使用 JAVA 将 PDF 转换为 PPT:完整指南
java·开发语言·pdf转ppt
qq_12498707537 分钟前
基于springboot归家租房小程序的设计与实现(源码+论文+部署+安装)
java·大数据·spring boot·后端·小程序·毕业设计·计算机毕业设计
是一个Bug9 分钟前
Java后端开发面试题清单(50道)
java·开发语言·jvm
GIS 数据栈10 分钟前
【Seggis遥感系统升级】用C++高性能服务Drogon重构软件服务架构|QPS提升300%,性能再升级!
java·开发语言·c++·重构·架构
2301_7806698615 分钟前
List(特有方法、遍历方式、ArrayList底层原理、LinkedList底层原理,二者区别)
java·数据结构·后端·list