Application Settings and Error Handling
Prem Kumar Karunakaran · Apress eBooks · 2020
Before Play 2.6, the practice was to use a global object to define application-level configurations and processing logic like filtering, error handling, etc. This approach was deprecated in Play 2.5.x and dropped since Play 2.6.x. The recommended approach since Play 2.6.x is to use dependency injection. Hence I won’t go into the details of the approach followed prior to 2.6.x and instead will direct your attention to the dependency injection approach. I will give you an example at the end of this section so that you are aware how it was done before, which will be helpful if you’re migrating an older Play framework project to the newer version.