Annotation « playframework « Java Enterprise Q&A

1. What's the difference between @After and @Finally annotations for Play controllers

The documentation isn't very clear on this. Can someone illuminate the differences between these two? @After - Methods annotated with the @After annotation are executed after each action call for this ...

2. How to read annotation value in play framework templates?

I want to use values from annotation in CRUD module templates, to utilize HTML5 functions. e.g. @Range(min=0, max=10) public int size; CRUD module use views/tags/crud/numberField.html to display number field:

#{field 'object.' + _name}

3. use of @Lob for field in playframework

In the play! tutorial,the content field of model Post is annotated as @Lob.I tried this, and when postgres was used as db,found that the table Post has a column named content ...

4. Generic wrapper method for Play! models

I'm trying to implement a RESTful interface for my Play! framework models using a generic wrapper. I want to use a generic method to call and return each model's respective "find" methods.

private ...

5. Play! framework renderJson not exposing particular fields

I'm trying to expose a dynamic(transient) field in my models via renderJson(), but it's not working. Here's an example:

public class Room extends Model {

  public String name;
  public String ...

6. mongodb module to use annotation for indexes

From the doc provided,, I don't see such annotation available but it seems that the code need to be write to create/specify indexes. Is that still the case ...

7. play! framework ignored @FilterDefs annotations in when deployed in .WAR?

I'm having problems with @FilterDefs annotations in when deployed in .war... the error it throws is: "... JPA error A JPA error occurred (Unable to build EntityManagerFactory): no filter condition ...

8. how to check @Before is working in play framework

I'm running play application. I have

import org.junit.Before;
public class Frontpage extends Controller {
    private static void commonData() {

9. java play framework override annotation failing with java.source=1.6

According to the document, if I define java.source in conf/application.conf then I should be able to apply @Override annotations to methods that implement an interface, but I'm still getting ...