Practical tips when using Play

We will conclude this chapter with a couple of recommendations that will help with the daily usage of the Play Framework.

Debugging with Play

Due to the declarative nature of functional programming and the powerful type checking mechanism of the compiler, debugging should happen less often when dealing with Scala code. However, if you need to debug a Play application in a situation, you might as well run a remote debugging session as you would in Java. To achieve this, just start your Play application with an extra debug command:

> play debug run

You should see an extra information line in the output that displays the following command line:

Listening for transport dt_socket at address: 9999

From here, you can add break points in your code and start a remote debugging configuration in Eclipse by navigating to the menu named Run | Debug Configurations…

Right-click on Remote Java Application and select New. Just make sure that you enter Port:9999 in the Connection Properties form and then start debugging by clicking on the Debug button.

Dealing with version control

Typical files that can be ignored when maintaining the code under version control tools such as GIT are located as follows:

  • logs
  • project/project
  • project/target
  • target
  • tmp
  • dist
  • .cache
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.12.50