Play Framework for Web Application Development
Play is one of the most popular frameworks powered by Java, which integrates components and APIs for modern web application development.
In this tutorial, you’ll see how to deploy Play at the platform without any code changes.
1. Java 8 is required for using the Play framework, so let’s create a suitable environment. For example, we’ll use the Oracle OpenJDK 8.0.22 version of the Tomcat application server.
2. Once the environment is ready, you can deploy your Play application. We are using the following Hello World package as a sample:
https://example.lightbend.com/v1/download/play-samples-play-java-hello-world-tutorial
3. Our application works on the 9000 port, so it should be opened via the container firewall. Add a new inbound rule similar to the image below.
4. Now, you should allow access to your application’s 9000 port from outside the platform (i.e. via SLB) by adding an endpoint.
5. Next, let’s access application via SSH (e.g. Web SSH) to manage it. Use the following command to disable default Play filter for allowed hosts:
|
|
6. Execute the next two commands sequentially to move into the application’s directory and run it.
|
|
7. Now, you can access your application in the browser using the Access URL of the endpoint you’ve created earlier.
In our case, the following page should be displayed:
That’s it! Your Play application is up and running, try the platform for yourself with a two-weeks trial at one of our partners.