Category: Play Framework

0

Intercepting and manipulating requests in Play Framework

There are situations when you have to intercept all requests coming into your application in order to do some processing prior to handling the request or doing some cleanup after it was handled. A good example that I usually give, and one that is widely used in many applications, is fishtagging for logging. This is when you write a unique identifier in the thread context and all messages are logged under the same tag (or NDC, as it was formally...

0

Handling Exceptions and Errors in Play Framework

When programming, it is important to always take into consideration exceptions. No matter how well your code is, there can always be invalid data summited by the user problems in other libraries that can trigger exceptions. Also, using this mechanism is an easy way of terminating invalid flows as soon as possible. Exceptions are normal and should be treated in all services. Even in case of an exception, we must provide a response to the user so that he knows...

2

Building a REST API in Play Framework

When building web applications, REST has become the most widely used approach because it is easy to use and easy to implement. In this tutorial I will be showing how to build a simple REST API in Play Framework and will cover the 4 basic functionalities: Create – POST Update – PUT Retrieve – GET Remove – DELETE We will be creating a simple API for a student’s management software where we can manipulate the students and retrieve the stored...

2

Building a form in Play Framework

Play Framework has some very useful utilities and helpers for generating forms. In this simple tutorial I will be showing how to build a form in Play Framework in Java, how to validate the input and display any validation errors.