If you ever need an example of how to do something when a Play Framework application starts up, check out the Zentasks application in the Play distribution samples directory. You'll find the following code in the Global.scala file in the app subdirectory of the project. It shows how to use the onStart
method of the Global
object to populate some sample data when the Play Framework app starts up.
Here's the source code for that class: