SPRING CONCEPTS

WAR · Web Application Archive

Spring Concepts / WAR · Web Application Archive

A WAR packages a Java web application in its deployable layout.

Understand the idea

The archive contains public web resources, WEB-INF/classes for compiled application classes, and WEB-INF/lib for packaged libraries. A Servlet container deploys it. The Maven war plugin produces the archive from source folders.

A concrete example

mvn clean package
→ target/todo-servlet-jsp.war
→ copy to Tomcat/webapps/

In the application

The beginner app’s finalName is todo-servlet-jsp, so its normal deployment context is /todo-servlet-jsp.

A WAR deployment is different from Boot’s executable JAR. This app has no main method.

Related concepts

Read the official documentation ↗
Java 21 · Spring Boot 4.1.1 · Edupoly