playframework - Getting "reference is ambiguous and double imported" errors in a simple form -


i have following simple model , view

package models;

import play.db.ebean.model;  import javax.persistence.entity;  @entity public class safari extends model {      public string name; } 

views/safari/add.html.scala

@(myform: play.data.form[safari])  @helper.form(action = routes.safari.submit()) {   @helper.inputtext(myform("username"))   @helper.inputpassword(myform("password")) } 

i getting following error after adding line @(myform: play.data.form[safari]) in view

reference safari ambiguous; imported twice in same scope import controllers._ , import models._

the controllers , models packages imported default in views. since have both controller , model named safari compiler doesn't know 1 use play.data.form[safari].

you need either rename controller or model differentiate them or use full package name in view.

@(myform: play.data.form[models.safari]) 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -