playframework 2.x标签编译错误
我想创建并使用 tag
,在playframework 2中重用我的html组件 .
我的标签: /views/mytags/words_tag.scala.html
码:
@(words: List[String] = List())
<ul id="words">
@for(word <- words) {
<li> <a href="/article/@word" onclick="#">@word</a></li>
}
</ul>
尝试在我的 index.scala.html
中使用:
@import views.mytags._
@words_tag(words)
结果我在页面上有一个编译错误:
illegal start of simple expression * app / views / index.scala.html第9行 . *
@import views.mytags._
为什么?
Updated: LOG is:
sbt.PlayExceptions $ CompilationException:编译错误[简单表达式的非法启动]在sbt.PlayReloader $$ anon $ 2 $$ anonfun $ reload $ 2 $$ anonfun $ apply $ 15 $$ anonfun $ apply $ 16.apply(PlayReloader.scala:349 )〜[na:na] at sbt.PlayReloader $$ anon $ 2 $$ anonfun $ reload $ 2 $$ anonfun $ apply $ 15 $$ anonfun $ apply $ 16.apply(PlayReloader.scala:349)〜[na:na] at scala .Option.map(Option.scala:133)〜[scala-library.jar:na] at sbt.PlayReloader $$ anon $ 2 $$ anonfun $ reload $ 2 $$ anonfun $ apply $ 15.apply(PlayReloader.scala:349) 〜[na:na] at sbt.PlayReloader $$ anon $ 2 $$ anonfun $ reload $ 2 $$ anonfun $ apply $ 15.apply(PlayReloader.scala:346)〜[na:na] at scala.Option.map(Option . scala:133)〜[scala-library.jar:na]
2 years ago
您的文件名为
words_tag.scala.html
,而不是words_tags
. 最后的差异s