Setting up a Spring MVC application

Let's figure out how a Spring MVC web application is configured by analyzing the application artifacts listed in the previous section, Your first Spring MVC application. It contains all the necessary artifacts for building a Spring MVC web app.

The project structure of a Spring MVC application

The easiest way to create the project structure and the necessary artifacts is using STS to create a Spring MVC project, as described in the previous section. Alternatively, you may use one of the Maven archetypes available in various repositories online. STS uses such a bundled archetype. Here is the typical project structure of a Spring MVC application as viewed in STS:

This structure represents a single-WAR web application ...

Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.