Chapter 4. Basic web forms

This chapter covers

  • Building a web form
  • Externalizing strings in a view
  • Validating and saving form data

Web forms provide a means by which we can collect data from end users. As such, they’re a key aspect of any nontrivial web application. This chapter shows how to use Spring Web MVC and related technologies to build a simple user registration form with standard features such as redirect-after-post, externalized strings, form data validation, and persistence.

Our approach is hands-on and practical. See Spring in Action, 3rd edition by Craig Walls (Manning, 2011) for additional material on Spring Web MVC.

4.1. Displaying a web form

Prerequisites

None

Key technologies

Spring Web MVC, Spring form tag library ...

Get Spring in Practice 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.