2015年10月29日
摘要:
需要为Blog添加 查看和发表评论的功能1.创建查看功能Application.java中添加 show() 方法public static void show(Long id) { Post post = Post.findById(id); render(post);}创建 app/...
阅读全文
posted @ 2015-10-29 10:23
alex_cool
阅读(472)
推荐(0)
2015年10月28日
摘要:
程序以及基本可用了,需要继续完善页面1.创建页面模板创建文件app/views/tags/display.html*{ Display a post in one of these modes: 'full', 'home' or 'teaser' }* ${_post.ti...
阅读全文
posted @ 2015-10-28 14:42
alex_cool
阅读(870)
推荐(0)
摘要:
上一篇最后出现的错误是因为断言assertEquals(1, Post.count()); 出错,取到的Post的数量不是1,运行Test之前,表中有数据可以添加以下方法,运行Test前清空数据@Beforepublic void setup() { Fixtures.deleteAll();} ...
阅读全文
posted @ 2015-10-28 14:12
alex_cool
阅读(788)
推荐(0)
摘要:
1.添加Post类package models;import java.util.*;import javax.persistence.*;import play.db.jpa.*;@Entity@Table(name = "blog_post")public class Post extends ...
阅读全文
posted @ 2015-10-28 11:35
alex_cool
阅读(517)
推荐(0)
摘要:
1.开发DataModel在app\moders 下新建User.javapackage models;import java.util.*;import javax.persistence.*;import play.db.jpa.*;@Entitypublic class User extend...
阅读全文
posted @ 2015-10-28 10:48
alex_cool
阅读(606)
推荐(0)
摘要:
A blogengine projectyabe.1.创建工程>play new yabe 设置Application Name:Yet Another Blog Engine. 2.创建Eclipse配置文件>play eclipsify yabe导入Eclipse3.修改index.html#{...
阅读全文
posted @ 2015-10-28 10:20
alex_cool
阅读(709)
推荐(0)
2015年10月27日
摘要:
熟悉的Hello World新创建一个工程,了解下重要文件的结构.\appcontrollers\models\views目前比较流行的MVC架构.\confapplication.conf 工程配置,包括数据库连接等routes 路由配置,用于解析URL找到.\app\views\...
阅读全文
posted @ 2015-10-27 16:06
alex_cool
阅读(362)
推荐(0)
摘要:
安装环境:jdk 1.7; play 1.3.1; eclipse安装指南:http://play-framework.herokuapp.com/zh/install安装Play Framework之前,要先安装JDK 1.5以上版本(1.8不支持play 1.3.1)*一定要配置正确jdk的环境...
阅读全文
posted @ 2015-10-27 14:16
alex_cool
阅读(2657)
推荐(0)
摘要:
AngularJS 指令AngularJS 指令是扩展的 HTML 属性,带有前缀ng-。ng-app 指令ng-app指令定义了 AngularJS 应用程序的根元素。ng-app指令在网页加载完毕时会自动引导(自动初始化)应用程序。ng-init 指令ng-init指令为 AngularJS 应...
阅读全文
posted @ 2015-10-27 11:02
alex_cool
阅读(164)
推荐(0)
摘要:
AngularJS 表达式AngularJS 表达式写在双大括号内:{{ expression }}。AngularJS 表达式把数据绑定到 HTML,这与ng-bind指令有异曲同工之妙。AngularJS 将在表达式书写的位置"输出"数据。AngularJS 表达式很像JavaScript 表达...
阅读全文
posted @ 2015-10-27 10:53
alex_cool
阅读(294)
推荐(1)