Frage

I have updated my controllers with to use play.data.Form.form() method instead of Controller.form(). When I try to run my application I get errors like:

error: method render in class create_user cannot be applied to given types;

return ok(create_user.render("", Form.form(CreateUserInfo.class), creator.get())); 

required: String, play.api.data.Form, User found: String, play.data.Form, User

It looks like the my templates expect to get play.api.data.Form instead of play.data.Form. Is there suppost to be any implicit conversion or should I update my templates to use play.data.Form?

If I'm using play.data.Form in my templates I am missing out on some of the features of play.api.data.Form, like the ability to request parameters through the apply method ( ex: createUserForm("username") )

War es hilfreich?

Lösung

The solution was provided by Guillaume Bort at the playframework google group.

I forgot to add javaCore as a dependency for my application after updating Build.scala. You have to explicitly add javaCore as a dependency in 2.1.

val appDependencies = Seq(
      javaCore
)

And remember to start using play.Project instead of PlayProject:

val main = play.Project(appName, appVersion, appDependencies).settings(
      // Add your own project settings here
)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top