`
mx285545974
  • 浏览: 9521 次
  • 性别: Icon_minigender_1
  • 来自: 西安
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论
文章列表
Find by ID: Post aPost = Post.findById(5L); Find all: List<Post> posts = Post.findAll(); List<Post> posts = Post.all().fetch(); List<Post> posts = Post.all().fetch(100);  List<Post> posts = Post.all().from(50).fetch(100); 简化查询: Post.find("byTitle", "My first ...
Play framework是完全无状态的,所有的HTTP请求都经过如下过程:     1.所有请求被 Play framework接受           2.路由组件查找所有的路由,找到能够接受这个请求的,然后相对应的action中的方        法就将被调用.        3.应用程序执行。(action对应方法的代码)         4.如何需要生成复杂的view,那么模版文件将被渲染,呈现.        5.action方法中的结果将会被写成HTTP的一个response,返回客户端.       过程图如下:              
Template inheritance(模版的继承):          使用extends标签继承模版:#{extends 'main.html' /} Create tags(创建标签):          创建:把要创建的标签放入app/views/tags文件下,比如创建hello.html内容                 为:             Hello from tag!          不需要配置,直接使用:#{hello /}                   获得标签属性:变量名的命名是由'_'与属性名组成的               Hello ${_ ...
Play 有一套高效的模版系统,它可以由有格式的文本来动态的生成Html,Xml,JSON或者其他文本。它的Template Engine使用Groovy作为表达式语言。 以下举几个例子: 1.Expressions : ${…}                  <h1>Client ${client.name}</h1 ...
ruby on rails的Guide 是这样写的:      1.Using resource identifiers (which, for the purposes of discussion, you can think of as URLs) to represent resources.     2.Transferring representations of the state of that resource between system components.

Play framework安装

    博客分类:
  • Play
下载地址:http://download.playframework.org/ 解压后,开启cmd, F:\play-1.0-r678\framework>  ant 设置环境变量F:\play-1.0-r678到Path 新开cmd,输入play,若看到如下图案,即为成功.        _            _ _ __ | | __ _ _  _| | | '_ \| |/ _' | || |_| |  __/|_|\____|\__ (_) |_|            |__/ play! 1.0-RC-localbuild, http://www.playfram ...
Global site tag (gtag.js) - Google Analytics