Url Path Binding w/o Boilerplate

Posted by & filed under Coding.

Update: Just noticed that I forgot to mention, that the following line has to be added to the main method of project/Build.scala: routesImport += “binders._” Regarding the previous post, it makes sense to provide a special Enumeration type which is bindable by the Play framework:

Play with Scala: Url Path Binding

Posted by & filed under Coding.

With Play and Scala, type-safe web development is a breeze. The following example shows how Play parses url paths and derives values of an Scala enumeration. There are two valid url paths: /signup/company and /signup/sales. Other url paths, such as /signup/unknown are properly handled as invalid. Play handles routes with variable parts like /signup/:account. In… Read more »