I wanted to have Version numbers that get automatically updated when I want to release a new version, so I set about to find out how to do this with Play Framework. I discovered that I could base it on the sbt-release plugin, but it was not so straight forward. Here is my strategy, so that in the end all ...
Read More »Home »
It’s easy to document your Play Framework REST API with Swagger
This post originally ran on http://swagger.io (7/30/2015) I having been using Play Framework as a Java-based, lightning-fast REST backend framework for several projects. Later, I was was excited to find Swagger and worked to integrate it into a few projects. As I struggled with it the first time, I thought it would be useful to share my experience and create ...
Read More »How to use Hibernate to generate a DDL script from your Play! Framework project
Ok, so you have been using the hibernate property name=“hibernate.hbm2ddl.auto” value=“update” to continuously update your database schema, but now you need a complete DDL script? Use this method from you Global Class onStart to export the DDL scripts. Just give it the package name (with path) of your Entities as well as a file name: public void onStart(Application app) { exportDatabaseSchema("models", ...
Read More »Programming a simple slot machine game using Java
No matter how simple or complex the game is, Java can do the job! On this post, let’s take a look at how beginners of Java programming can make a simple, yet fully functional slot machine. Slot machines have been around for a long time, but its entertainment value doesn’t seem to fade one bit. InterCasino, the first website to offer ...
Read More »How to implement a Session Timeout in Play Framework 2
If you follow the Play Framework 2 guide for implementing authentication: http://www.playframework.com/documentation/2.2.2/JavaGuide4 — you will notice that there is no session timeout in Play Framework 2. It was there in Play Framework 1, but Play Framework 2 follows a different approach. I you want to implement your own session timeout, then follow the guide for setting up authentication, by extending ...
Read More »How to configure an SSL Certificate with Play Framework for https
I spent hours trying to get this to work, and in the end, then problem was that I did not generate the CSR (Certificate Request) myself with the keytool. I kept getting this error when I tried accessing Play with https: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated The problem ended up being that the keystore I created and imported the SSL certificate ...
Read More »How to use Reflection to Document your Data Model based on JPA Annotations
So using JPA, Hibernate or EBeans is cool when you can just annotate your Java classes, but haven’t you always wished you could “generate” documentation of your data model from the code? Pulling information of the the JPA / Hibernate and other validation annotations? Assuming you have all those nice Annotations in your beans: @Entity @Table(name ...
Read More »Using twitter4j with Play! Framework and Secure Social is this easy
During yesterday’s personal Hackathon, I started a project which I might introduce here sometime. But the coolest revelation was (again) how easy it was to get up and running. Create a new Play Project Add Secure Social and configure it for Twitter, and use the InMemoryUserService from the examples. (all this is described here http://securesocial.ws/guide/getting-started.html and only takes a minute) ...
Read More »