Wednesday, May 25, 2016

Migrating to Play 2.5 - can GlobalSettings be removed?

The post Migration from Play 2.4 to Play 2.5 explains the mandatory steps of migration to Play 2.5.
According to Migration guide removing of GlobalSettings implementation class is strongly recommended, but is optional. The exact recommendation is to move from it as much code as possible and in ideal to remove it at all.

In previous Play releases hooking of the application start-up, shut-down and request interception was done with a class Global, which extends the default GlobalSettings.
Such Global exists also in my project to be migrated to Play 2.5.

Monday, May 23, 2016

Migration from Play 2.4 to Play 2.5

The Play 2.5 migration guide gives general guidelines of what to do. As usual in Play documentation only few issues are really explained in details with "how to do".
This post fills the gaps (in scope of my experience in migrating the project).

Sunday, May 22, 2016

Making Play route case-insensitive - part 2

The previous post (part 1) explains, how to make the URL route case-insensitive.

If a URL contains some query parameters, additional treatment should be done in order to make the query parameters case insensitive as well.

Saturday, May 21, 2016

Making Play route case-insensitive - part 1

Play routes are case sensitive. It means, that if the route is defined like this:
 GET /thisIsMyPage       controllers.HomeController.exactRoute
the URL should match exactly the route including the letters case. Any attempt to provide different letter cases in the URL will result with NotFound error.

The one and only "good" URL is:

Wednesday, May 18, 2016

Adding a custom folder to Play application distribution package

By default Play application distribution package is created as a directory tree, containing all necessary files for running the application.
A real application may demand adding more files or folders into the distribution.

Let's see, how to customize a Play application distribution package.

Friday, May 13, 2016

Integrating Play and AngularJs detached projects

Play and Angularjs are two frameworks for development of Web applications. The play-angular-seed template of the Typesafe activator suggests the incorporation of the Angularjs in Play.

There is another approach, suggesting to make development with the Angularjs outside the Play and integrate the both parts only in run-time.

Working with static html files in Play

Play comes with its own template engine, which compiles the Play views of type *.html.scala into static html files.

But what if we need to use instead of a Play view a plain html file?
For this purpose Play has a build-in static assets controller.

Wednesday, May 11, 2016

Creating of a maven project for Play application

While developing with Play/Java maven is more preferable, then sbt. It is the "native" Java tool and has a lot of plugins. Another reason to use maven - when a Play application is a part of a project, managed with maven.

Sunday, May 8, 2016

Getting started with Play Framework

Getting started with Play framework depends on the Play version. The official site describes the similar installation procedure for Play 2.4.x and almost all releases of Play 2.5. It suddenly changes to the different one starting in the couple of recent releases of Play 2.5.
Let's put all this to order.

About the author

My Photo
I trust only simple code and believe that code should be handsome. This is not a matter of technology, but professional approach, consolidated after years of software development. I enjoy to cause things working and feel very happy, when I manage to solve a problem.
Back to Top