In my previous blog (see validations for the play framework) I showed you how easy it can be to handle validations with the play framework. This time I will try to explain how this can be combined with the controllers in the playframework to handle these errors.
The controllers in the playframework are the central entry point from the web to your domain. Each controller should extend playframework’s Controller and have a static void method for each action that can be done on the controllers. These actions are static since they are supposed to be a binding point between the stateless aspect of http towards the statefull objects of your models. The actions are bound to urls and type of request (POST or GET) through the routes configuration file. Using the routes configuration file you can create nice looking rest-like url’s that are bound to the controllers. Also this routes file will be used to generate the urls for you if you add them to your view template files. For instance, given that your routes file contains the following route: Continue reading “Playframework: handling of validated objects”