播放2:模板中的"对表单的引用是模糊的"错误消息

 薇洁诗婷梦添 发布于 2023-02-02 20:20

我试图按照书中的代码示例构建一个play2应用程序:我在创建一个具有以下定义的表单模板时遇到困难:@(productForm:Form [Product])

@main("Product Form") {

Product Form

@helper.form(action = routes.Products.save()) {
Product (@productForm("name").valueOr("new")) @helper.inputText(productForm("wan"), '_label -> "EAN") @helper.inputText(productForm("name"), 'label -> "Name") @helper.textarea(productForm("description"), '_label -> "Description")
Cancel } }

我得到以下eclipse(我安装了scala ide插件)

Multiple annotations found at this line:
    - reference to Form is ambiguous; it is imported twice in the same scope by import play.data._ and 
 import play.api.data._

我应该忽略这条消息吗?play compile运行正常,但我没有从表单中获得任何输出.

1 个回答
  • 为了纠正我必须插入的日食错误

     @(productForm: play.data.Form[Product])
    

    代替:

     @(productForm: Form[Product])
    

    2023-02-02 20:27 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有