controller « playframework « Java Enterprise Q&A





1. How do Play controllers inject variables with the proper name into templates?    stackoverflow.com

In the Play getting started docs, they show this controller:

public static void index() {
  Post frontPost = Post.find("order by postedAt desc").first();
  List<Post> olderPosts = Post.find("order by postedAt ...

2. Is it possible to embed controllers with Play Framework?    stackoverflow.com

I have two forms, each with their own actions. Then I have a page which is supposed to embed these two forms in a single page. Is it possible to embed/include other ...

3. Play Framework messages in controller    stackoverflow.com

How can I access a value from the "messages" file in a controller? For example, in my "messages" file:

app.name = Play Framework App
How can I get the value of app.name ...

4. Calling static methods in Play! framework controller doesn't work    stackoverflow.com

I have a Play! framework with two actions which contain redundant code. So I factored this code into a private static method, but It doesn't work anymore then.

  public static ...

5. Call a controller method within Play! template    stackoverflow.com

How can I call a controller method from within a Play! template? I have a default controller, Application, and the hasliked() method inside that controller. The method returns whether the logged in user ...

6. Do multiple @Before methods work in Controller inheritance?    stackoverflow.com

I'm trying something similar to this, and only one of the @Before methods gets called:

public abstract class ControllerBase extends Controller {
  @Before
  static void foo() {
    ...