Hi I would like to import Play framework Java Exension* into a Play framework Model.
In specific I’d like to have in my model:
package models;
// various import
import play.templates.JavaExtensions;
@Entity
public class Product extends Model {
@PrePersist
public void save_slug(){
slug = title.slugify();
}
}
But I’m receiving following error
The method slugify() is undefined for the type String
What am I doing wrong?
*references:
– http://www.playframework.org/documentation/1.1/javaextensions#aslugifya
– http://www.playframework.org/documentation/api/1.2.4/play%2Ftemplates%2FJavaExtensions.html
Java extensions are static methods of
JavaExtensionsclass, you can use them as follows: