Play framework problem with form

3

Introduction

I'm starting to develop with the Play Framework. I'm making an ALL list template with it.

Problem

When I am instantiating my form in the controller it returns me the following error:

Would anyone know what the problem is?

Controller (Application.java)

package controllers;

import play.*;
import play.mvc.*;
import play.data.*;
import play.data.Form;

import views.html.*;

import models.*;

public class Application extends Controller {
    static Form<Task> taskForm = form(Task.class);

    public static Result index() {
        return redirect(routes.Application.tasks());
    }

    public static Result tasks() {
        return TODO;
    }

    public static Result newTask() {
        return TODO;
    }

    public static Result deleteTask(Long id) {
        return TODO;
    }

}
    
asked by anonymous 07.10.2014 / 14:25

2 answers

6

Change:

form(Task.class);

To:

Form.form(Task.class);

Or if you prefer, statically import Form methods like this:

import static play.data.Form.*;

And continue using it the way you did.

    
07.10.2014 / 14:33
1

Place Form.form(Task.class); instead of error.

In this link you have an example of a CRUD with master-detail: Play Crud Master-Detail

    
10.11.2014 / 20:25