【发布时间】:2026-01-21 14:20:04
【问题描述】:
试图将我的项目拆分为几个子模块。 我创建了子模块: /模块/公共 /模块/购物
现在我正在尝试将名称空间转换为包括新结构在内的新名称空间。
我的控制器:
package controllers.common;
public class Index extends Controller {}
我的模特:
package models.common;
@Entity
public class AppMode {}
我的看法:
@(AppModeForm: Form[models.common.AppMode], CurrentMode: Boolean)
@helper.form(common.routes.CMS.appModeSubmit, 'id -> "form") {}
而且我总是遇到错误。 F.e: 视图中的错误:
reference to common is ambiguous; it is imported twice in the same scope by import controllers._ and import models._
[error] /home/kd/Application/modules/common/app/views/CMS/AppModeView.scala.html:9: reference to common is ambiguous;
[error] it is imported twice in the same scope by
[error] import controllers._
[error] and import models._
[error] @helper.form(common.routes.CMS.appModeSubmit, 'id -> "form") {
[error] ^
[error] one error found
【问题讨论】:
标签: java namespaces routes playframework-2.0 sbt