zoukankan      html  css  js  c++  java
  • Play Framework 完整实现一个APP(一)

     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 !

    ..

  • 相关阅读:
    使用nginx搭建https服务器
    CentOS6.*安装gitolite
    Nginx 下配置SSL证书的方法
    Nginx Location配置总结
    最优二叉树(哈夫曼树)知识点
    utf8字节
    utf8字节
    nginx 配置日志
    nginx 配置日志
    elk 索引
  • 原文地址:https://www.cnblogs.com/alex09/p/4916313.html
Copyright © 2011-2022 走看看