作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
嗨,我是 java 游戏框架的新手,我正在遵循本教程
http://www.playframework.com/documentation/2.2.x/JavaTodoList
标题“渲染第一页”下
public static Result tasks() {
return ok(
views.html.index.render(Task.all(), taskForm)
);
}
我在渲染行使用 Eclipse Eclipse 显示错误消息
类型索引中的方法 render(String) 不适用于参数 (List,Form)
由于我是初学者,我正在按照本教程来学习 Play Framework ,我不知道为什么会出现此错误请帮忙提前致谢
最佳答案
当我在 eclipse 中看到编译错误时,我也像你一样困惑..:)
我只是忽略了 eclipse 编译错误并刷新了页面。即使在“Task”类之前没有包名称,它也能工作。
我认为 Eclipse 无法理解它,除非 play 编译器用新的更改编译“index.scala.html”。
所以不用担心,只需刷新页面,您就会看到想要的结果。
关于java - 类型索引中的方法 render(String) 不适用于 play 2.2.x 中的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23989099/
我是一名优秀的程序员,十分优秀!