img
Listing 17-37. The Add Contact View Mapping
<definition extends="default" name="contacts/create">
<put-attribute name="body"
value="/WEB-INF/views/contacts/edit.jspx" />
</definition>
The add view is now complete. After you rebuild and deploy the project, click the New Contact link
in the menu area in Figure 17-10. The add contact view will be displayed, as shown in Figure 17-15.
Figure 17-15. Add contact view
Enable JSR-303 Bean Validation
Let's configure JSR-303 Bean Validation support for the create and update contact actions. First, apply
the validation constraints to the Contact domain object. In this sample, we define constraints only for
the firstName and lastName attributes. Listing 17-38 shows the code snippet for the annotations applied
to the firstName and lastName attributes.
Listing 17-38. Applying Constraints to the Contact Domain Object
package com.apress.prospring3.ch17.domain;
// Import statements omitted
@Entity
@Table(name = "contact")
public class Contact implements Serializable {
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home