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 !
..
新聞熱點
疑難解答