The Play Framework is an awesome change from JavaEE. I like how they embrace Object Oriented design throughout the framework. The Play Framework is Java’s version of Django or Ruby on Rails. By default, it uses EBean as the ORM and it has been a refreshing change from Hibernate as well. It is the the most rapid web development framework that I have used in Java. I came across my first curve-ball with it that was not easy to find when googling it.
I don’t like flat project structures. I always plan that even the smallest projects will have a ton of models, controllers, and views and they should all be segregated in their own folders/packages. I placed my logged-in controllers in their own package in controllers.tracker.*. The trick was to get the routes object to work.
I assumed that routes.tracker.DashboardController.index() would work, nope. Apparently there is a routes object at each level of the package structure under the controllers package. So here’s what worked: