Skip to main content

Using the Play console

Launching the console

The Play 2.0 console is a development console based on sbt that allows you to manage a Play application’s complete development cycle.

To launch the console, enter any existing Play application directory and run the play script:

$ cd /path/to/any/application
$ play 
 

 


 
 

Getting help

Use the help play command to get basic help about the available commands:

[My first application] $ help play

 

Running the server in development mode

To run the current application in development mode, use the run command:

[My first application] $ run








In this mode, the server will be launched with the auto-reload feature enabled, meaning that for each request Play will check your project and recompile required sources. If needed the application will restart automatically.

If there are any compilation errors you will see the result of the compilation directly in your browser:

To stop the server, type Crtl+D key, and you will be returned to the Play console prompt.


Compiling

In Play 2.0 you can also compile your application without running the server.

Just use the compile command:

[My first application] $ compile







Debugging

You can ask Play to start a JPDA debug port when starting the console. You can then connect using Java debugger. Use the play debug command to do that:

$ play debug
 
When a JPDA port is available, the JVM wil log this line during boot:

Listening for transport dt_socket at address: 9999
 
Note: Using play debug the JPDA socket will be opened on port 9999. You can also set the JPDA_PORT environment variable yourself using set JPDA_PORT=1234.




Comments

Popular posts from this blog

JavaMelody: Monitoring the Performance of Tomcat Application Server

Javamelody is an opensource (LGPL) application to monitor Java or Java EE application servers in QA and production environments. JavaMelody is mainly based on statistics of requests and on evolution charts. (Extract from the Javamelody home page) It allows to improve applications in QA and production Give facts about the average response times and number of executions Make decisions when trends are bad, before problems become too serious Optimize based on the more limiting response times Find the root causes of response times Verify the real improvement after optimization It includes summary charts showing the evolution over time of the following indicators: Number of executions, mean execution times and percentage of errors of http requests, sql requests, jsp pages or methods of business façades (if EJB3, Spring or Guice) Java memory Java CPU Number of user sessions Number of jdbc connections These charts can be viewed on the current day, week, month, year or cu...

Configure Tomcat Web Management Interface

We already see, how to install tomcat in ubuntu in my previous blog( http://kmlsarwar.blogspot.com/2014/08/how-to-install-apache-tomcat-on-ubuntu.html ) In order to use the manager webapp installed, we must add a login to our Tomcat server. We will do this by editing the tomcat-users.xml file: sudo nano /etc/tomcat7/tomcat-users.xml    This file is filled with comments which describe how to configure the file. You may want to delete all the comments between the following two lines, or you may leave them if you want to reference the examples: <tomcat-users> </tomcat-users>  You will want to add a user who can access the manager-gui and admin-gui (the management interface that we installed in Step Three). You can do so by defining a user similar to the example below. Be sure to change the password and username if you wish: <tomcat-users> <user username="admin" password="password" roles="manager-gui,admin-gui"...

How to install Oracle JDK on Ubuntu from repository

This package provides Oracle Java JDK 7 (which includes Java JDK, JRE and the Java browser plugin). However, you can't only install Oracle JRE - the PPA only provides the full Oracle JDK7 package. To install: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-jdk7-installer And to uninstall: sudo apt-get remove oracle-jdk7-installer And to verify your installation: java -version java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode) And to verify the web browser installation: http://java.com/en/download/installed.jsp Verified Java Version Congratulations! You have the recommended Java installed (1.7.0_51). And to update: If for some reason, the Java version in use is not 1.7.0, you can try to run the following command: sudo update-java-alternatives -s java-7-oracle To Install and Set in environment variable: To...