Chapter 3. Building web applications with Spring Web MVC


This chapter covers

  • Creating your first Spring Web MVC application
  • Serving and processing forms
  • Configuring Spring Web MVC
  • Spring Mobile technology preview

This book is mostly about web application development, partly because that’s where the bulk of your authors’ experience lies, and partly because there’s enough interesting material to support an entire book. (Actually, there’s enough to support a lot of books, as any visit to your local bookstore will reveal.) Therefore most of the recipes involve some amount of web-related code and configuration, and you’ll find that many of the same ideas and techniques recur throughout. Instead of repeating those over and over, we’ll take a moment to discuss the basics here. This way, you can easily refer back to this material for review as you work through the recipes ahead.

Despite the large number of Java web frameworks, we’re going to concentrate our efforts around using and understanding Spring Web MVC, which is the web framework that ships with Spring. We’re more concerned with covering a variety of business problems using core Spring technologies and less concerned with covering every available technical option. No doubt the technical alternatives are interesting in their own right, but given our limited space we’ll leave that treatment for reference manuals.

3.1. Spring Web MVC background

3.2. Creating your first Spring Web MVC application

3.3. Serving and processing forms

3.4. Configuring Spring Web MVC: web.xml

3.5. Configuring Spring Web MVC: the application context

3.6. Spring Mobile technology preview

3.7. Related technologies

3.8. Summary