7顶
0踩
声明:ITeye资讯文章的版权属于ITeye网站所有,严禁任何网站转载本文,否则必将追究法律责任!
play!为不喜欢传统JEE臃肿框架的程序员提供了一个敏捷的Web开发框架。
www.playframework.org
此次更新主要有:
1.自定义静态文件存放路径
So, to keep serving files from /public directory with the /public path, just add :
2. 邮件系统支持
You can now define Mailer in your application. A mailer is subclass of play.mvc.Mailer, where each public static method send an email.
Example :
3. JPA重构
We have worked a lot on the JPA integration.
The JPA and JPAContext classes have been merged (JPAContext has been removed). Please replace the JPAContext.getEntityManager() call by JPA.getEntityManager().
A new find method is available in JPAModel :
You can still set your own query. Either with a shortcut :
Or by specifying a full JPQL query :
You can now count using a query :
Refresh and merge operation are directly available on JPAModel :
You can delete using a query :
You can still access the plain entityManager, with em() :
4.编译时间优化
The Java compilation process has been optimized and is now faster (especially for large projects).
Moreover, Play! now keep a Bytecode cache for all compiled resources (Java sources and templates). We keep an MD5 hash of the source code with each Bytecode and always compare it before to use a cached Bytecode.
This option is activated by default. You can disable it with :
in the application.conf file.
更多更新消息请看:
http://www.playframework.org/manual/contents/stable4
完整论坛程序下载:
http://www.playframework.org/download/samples/sample-forum.zip
www.playframework.org
此次更新主要有:
1.自定义静态文件存放路径
So, to keep serving files from /public directory with the /public path, just add :
GET /public staticDir:public
2. 邮件系统支持
You can now define Mailer in your application. A mailer is subclass of play.mvc.Mailer, where each public static method send an email.
Example :
package notifiers; import play.*; import play.mvc.*; import java.util.*; public class Notifier extends Mailer { public static void welcome(User user) { setSubject("Welcome %s", user.name); addRecipient(user.email); addAttachment(Play.getFile("rules.pdf")); send(user); } }
3. JPA重构
We have worked a lot on the JPA integration.
The JPA and JPAContext classes have been merged (JPAContext has been removed). Please replace the JPAContext.getEntityManager() call by JPA.getEntityManager().
A new find method is available in JPAModel :
Users.find().all(); // All results Users.find().one(); // The first result or null Users.find().page(1, 10); // First page with page size at 10
You can still set your own query. Either with a shortcut :
Users.find("email", email).one(); Users.find("email = ? and active = true", email).one();
Or by specifying a full JPQL query :
Users.find("from User u where u.email = ?", email).one(); Users.find("select u from User u where u.email = ?", email).one();
You can now count using a query :
Users.count(); // Count all user instances Users.count("active", true); // Count all active users
Refresh and merge operation are directly available on JPAModel :
User user = User.findById(2L); user.refresh(); User mergedUser = Cache.get("user", User.class).merge();
You can delete using a query :
Users.delete(); // delete all users Users.delete("active", false); // delete all inactive users
You can still access the plain entityManager, with em() :
public void delete() { em().delete(this); }
4.编译时间优化
The Java compilation process has been optimized and is now faster (especially for large projects).
Moreover, Play! now keep a Bytecode cache for all compiled resources (Java sources and templates). We keep an MD5 hash of the source code with each Bytecode and always compare it before to use a cached Bytecode.
This option is activated by default. You can disable it with :
play.bytecodeCache=false
in the application.conf file.
更多更新消息请看:
http://www.playframework.org/manual/contents/stable4
完整论坛程序下载:
http://www.playframework.org/download/samples/sample-forum.zip
21 楼 malligator 2009-07-17 00:48
我把它放在models里,一直报说找不到;
然后试一下把new File(.)的路径打出来,就是play!的安装目录,但我放在那里居然也不行
20 楼 laobu 2009-06-20 14:19
19 楼 fangzhouxing 2009-01-10 21:17
18 楼 Arden 2008-12-30 20:19
17 楼 Arden 2008-12-30 19:28
16 楼 jejwe 2008-12-08 12:46
15 楼 ixu 2008-12-08 12:40
14 楼 fight_bird 2008-12-07 11:51
13 楼 vonpower 2008-12-07 11:09
12 楼 glacier3 2008-12-06 21:06
11 楼 neora 2008-12-06 19:57
10 楼 crackcell 2008-12-06 10:02
9 楼 caiceclb 2008-12-06 09:36
8 楼 ruderal 2008-12-05 18:50
7 楼 avaj 2008-12-05 17:59
的确是一个非常不错的东西。试试你就知道咧。
6 楼 vdgame 2008-12-05 17:37
5 楼 fangzhouxing 2008-12-05 17:28
4 楼 peirenlei 2008-12-05 14:14
3 楼 seasar 2008-12-05 12:20
2 楼 Arden 2008-12-05 12:13