Chapter 7. Services and data binding
This chapter covers
- Using services for more maintainable architecture
- Data binding and error handling
- Using command objects for tricky form validations
- Uploading and rendering images
- Working with URL mappings and filters
In the previous chapter you learned the basics about what controllers do, how to extend them with your own logic, and how to test them. We haven’t yet introduced you to the best way to use controllers in building larger Grails applications.
In this chapter we examine the controller’s best friend: the Grails service. Services help free controllers from the heavy lifting of application logic, and let controllers do what they do best—control the flow of the user through the application. ...