Home » Tag Archives: Play Framework

Tag Archives: Play Framework

It’s easy to document your Play Framework REST API with Swagger

java-interview-questions-answers

This post orig­i­nally ran on http://​swag​ger​.io (7/30/2015) I hav­ing been using Play Frame­work as a Java-based, lightning-fast REST back­end frame­work for sev­eral projects. Later, I was was excited to find Swag­ger and worked to inte­grate it into a few projects. As I strug­gled with it the first time, I thought it would be use­ful to share my expe­ri­ence and cre­ate ...

Read More »

How to use Hibernate to generate a DDL script from your Play! Framework project

jboss-hibernate-logo

Ok, so you have been using the hiber­nate prop­erty name=“hibernate.hbm2ddl.auto” value=“update” to con­tin­u­ously update your data­base schema, but now you need a com­plete DDL script? Use this method from you Global Class onStart to export the DDL scripts.  Just give it the pack­age name (with path) of your Enti­ties as well as a file name: public void onStart(Application app) { exportDatabaseSchema("models", ...

Read More »

How to implement a Session Timeout in Play Framework 2

play-framework-logo

If you fol­low the Play Frame­work 2 guide for imple­ment­ing authen­ti­ca­tion: http://​www​.playframe​work​.com/​d​o​c​u​m​e​n​t​a​t​i​o​n​/​2​.​2​.​2​/​J​a​v​a​G​u​i​de4 — you will notice that there is no ses­sion time­out in Play Frame­work 2. It was there in Play Frame­work 1, but Play Frame­work 2 fol­lows a dif­fer­ent approach. I you want to imple­ment your own ses­sion time­out, then fol­low the guide for set­ting up authen­ti­ca­tion, by extend­ing ...

Read More »

Init.d shell script for Play framework distributed applications

play-framework-logo

I wrote a shell script to control Play framework applications packaged using built-in command dist. Applications packaged this way are zipped standalone distributions without any need to have Play framework installed on the machine that it’s supposed to run on. Everything needed is inside the package. Inside the zip, in the bin directory, there is an executable shell script named ...

Read More »

How to configure an SSL Certificate with Play Framework for https

play-framework-logo

I spent hours try­ing to get this to work, and in the end, then prob­lem was that I did not gen­er­ate the CSR (Cer­tifi­cate Request) myself with the keytool. I kept get­ting this error when I tried access­ing Play with https: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated The prob­lem ended up being that the key­store I cre­ated and imported the SSL cer­tifi­cate ...

Read More »

JavaScript routing in Play 2 (Scala edition)

play-framework-logo

In my previous post, I covered using JavaScript routing in Play 2 Java applications. Here’s the Scala version. It’s pretty much a copy of the previous article, to make it independent. One of the nicest features in Play 2, but one which doesn’t seem to be widely covered, is the JavaScript routing that can be generated by the framework to ...

Read More »

The Pros and Cons of Play and Grails Java Framework

play-framework-logo

Frameworks simplify the process of application development by providing some helpful features to programmers. Java frameworks are often used by developers and thanks to their popularity; you can find a range of Java development frameworks in the market. Newbie developers often post a common question in forums, “which Java framework is the best?” First of all, there is no one ...

Read More »

Lightweight real-time charts with Play Framework and Scala using server-side events

play-framework-logo

Continuing a great journey with awesome Play Framework and Scala language, I would like to share yet another interesting implementation of real-time charting: this time by using lightweight server-side events instead of full-duplex WebSockets technology described previously in this post. Indeed, if you don’t need a bidirectional communication but only server push, server-side events look as a very natural fit. ...

Read More »

Call response WebSockets in Play Framework

play-framework-logo

I got a question from a Play user about implementing call/response WebSockets in Play Framework. This is not something that comes up that often, since it means using WebSockets to do basically what AJAX does for you, so what’s the point? But here are some use cases that I’ve thought of: You have some transformation of a stream that can ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.