Play Framework fully implements an APP (1), frameworkapp
A blog engine projectYabe.
1. Create a project
>play new yabe
Set Application Name:Yet Another Blog Engine.
2. Create an Eclipse configuration file
>play eclipsify yabe
Import Eclipse
3.modify index.html
#{extends 'main.html' /}#{set title:'Home' /}
4. Modify Application. java
public static void index() { System.out.println("Yop"); render();}
Run the test to check whether the test is available.
5. Set database connection (PostgreSql is used in this example) and modifyApplication. conf
db.driver=org.postgresql.Driver db.url=jdbc:postgresql://localhost:5432/postgre jpa.dialect=org.hibernate.dialect.PostgreSQLDialect db.user=##### db.pass=#####
Run the program and refresh the page. The following prompt appears on the console, indicating that the configuration is correct.
INFO ~ Connected to jdbc: postgresql: // localhost: 5432/postgres for default
INFO ~ Application 'Et Another Blog Engine 'is now started!
..