您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息

PlayFramework完整实现一个APP(一)

2024/4/17 19:38:03发布5次查看
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 !
..
 以上就是playframework完整实现一个app(一)的内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录