Home >Backend Development >XML/RSS Tutorial >PlayFramework completely implements an APP (1)

PlayFramework completely implements an APP (1)

黄舟
黄舟Original
2016-12-23 16:34:401594browse

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' /}

A blog will be there< ;/h1>

 

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)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn