Home >Backend Development >XML/RSS Tutorial >PlayFramework completely implements an APP (1)
A blog engine PRoject yabe.
1. Create project
>play new yabe
Set application Name: Yet Another Blog Engine.
2. Create Eclipse configuration file
>play eclips ify yabe
Import into 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 and view Is it available
5. Set up the database connection (this example uses PostgreSql), modify application.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, refresh the page, and the following prompt appears on the console, that is Correctly configured
INFO ~ Connected to jdbc:postgresql://localhost:5432/postgres for default
INFO ~ Application 'Yet Another Blog Engine' is now started !
..
The above is the complete implementation of PlayFramework The content of an APP (1). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!