How implement a Bindable Object


Hi all,

i have a doubt with bindable objects. I explain my case:
I have this class:

public class Cat{
Integer cat_id;
String name;
String color;

and i want to send this class, for example to call this method:
addCat/:cat controllers.HomeController.addCat(cat: model.Cat)

but the system show this error:
No URL path binder found for type model.Cat. Try to implement an implicit PathBindable for this type.

I have read the documentation ( but I can’t understand how to implement this part.

Could someone clarify it to me?

Thanks and regards

(Marcos Pereira) #2

Hey @fabian,

The javadocs for PathBindable has an example:

For Scala, the missing bit in the docs is how to make your binders available to routes. To do that, you need to add a routesImport in your build.sbt:

import play.PlayImport.PlayKeys._

routesImport += "com.acme.Binders._"


1 Like