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

相关推荐
未来之窗软件服务几秒前
幽冥大陆(四十九)PHP打造Java的Jar实践——东方仙盟筑基期
java·php·jar·仙盟创梦ide·东方仙盟·东方仙盟sdk·东方仙盟一体化
普通网友7 分钟前
深入探讨Linux驱动开发:字符设备驱动开发与测试_linux 驱动开发设备号(2)
java·linux·驱动开发
4Forsee8 分钟前
【Android】动态操作 Window 的背后机制
android·java·前端
小二李17 分钟前
第12章 koa框架重构篇 - Koa框架项目重构
java·前端·重构
cike_y21 分钟前
JavaBean&MVC三层架构
java·架构·mvc·javaweb·java开发
漂亮的小碎步丶25 分钟前
【启】Java中高级开发51天闭关冲刺计划(聚焦运营商/ToB领域)
java·开发语言
SadSunset38 分钟前
(19)Bean的循环依赖问题
java·开发语言·前端
⑩-39 分钟前
Java自定义业务异常类
java
Adellle39 分钟前
Java爬虫入门(2/5)
java·爬虫
JIngJaneIL41 分钟前
基于Java+ vue图书管理系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot·后端