播放入门文档,它们显示出该控制器:

public static void index() {
  Post frontPost = Post.find("order by postedAt desc").first();
  List<Post> olderPosts = Post.find("order by postedAt desc").from(1).fetch(10);
  render(frontPost, olderPosts);
}

然后,在模板中的frontPost和olderPosts使用而无需任何特殊的映射!

<a href="#">${frontPost.title}</a>

如何播放保存这些名字?

有帮助吗?

解决方案

它是由代码注塑而成。

在编译,有些类被增强(与代码注入,通过的了Javassist )中,为了增加一些信息,例如变量名。

在渲染方法中,该操作是由“play.classloading.enhancers.LocalvariablesNamesEnhancer.LocalVariablesNamesTracer”类来完成。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top