星空网 > 软件开发 > Java

Play Framework 完整实现一个APP(一)

 A blog engine project yabe.

 

1.创建工程

>play new yabe 

设置Application Name: Yet Another Blog Engine.

 

2.创建Eclipse配置文件

>play eclipsify yabe

导入Eclipse

 

3.修改index.html

#{extends 'main.html' /}#{set title:'Home' /}<h1>A blog will be there</h1>

  

4.修改Application.java

public static void index() {  	System.out.println("Yop");    render();}

 运行测试,查看是否可用

 

 5.设置数据库连接(本例使用的是PostgreSql),修改application.conf

 db.driver=org.postgresql.Driver db.url=jdbc:postgresql://localhost:5432/postgre jpa.dialect=org.hibernate.dialect.PostgreSQLDialect db.user=##### db.pass=#####

运行程序,刷新页面,控制台出现以下提示,即为配置正确

 INFO ~ Connected to jdbc:postgresql://localhost:5432/postgres for default
 INFO ~ Application 'Yet Another Blog Engine' is now started !

 

 

..




原标题:Play Framework 完整实现一个APP(一)

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流