Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the SpringBlog application, Spring 3’s new type conversion and formatting system will be adopted. For validation, the JSR-303 Bean Validation API will be used, with Hibernate Validator as the underlying validation service provider.
To see how these techniques are adopted, let’s take the major entity class, the AbstractBlogPosting class, which is the base class for both blog posting entries and comments, as an example. The class stores the common properties such as the subject, body, and post date, among others.
The main validation and formatting rules of the properties within the AbstractBlogPosting entity class are as follows:
subject field is mandatory, and the number of characters should be between 10 and 50.