O'Reilly logo

Spring MVC: A Tutorial by Paul Deck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6

Converters and Formatters

In Chapter 5, Data Binding and the Form Tag Library you witnessed the power of data binding and learned to harness it using the tags in the form tag library. However, Spring data binding is not without limit. There are cases where Spring is clueless on how to bind data correctly. For example, Spring will always try to bind a date input to a java.util.Date using the default locale. If you want Spring to use a different date pattern, for example, you need to use a converter or a formatter to help Spring.

This chapter discusses the converter and the formatter. Both are used to convert one type of object to another. Converters are generic components that can be used in any tier of the application. Formatters, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required