使用Ninja马上两年了,之前多多少少的都是跟着项目模仿着写,今年上半年准备从一个小项目开始从始至终走一遍;

首先官网:http://www.ninjaframework.org;

github:  https://github.com/ninjaframework/ninja

微信公众号:

aaarticlea/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAFYAVgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD9U6KKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigBpbBpQSQDigjN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qK/lX9KAP6p84xX8rBGDX9UxXOKUAgAZoACcDJoyKCeOtfyte3p3oA/qlyOvav5WCMGv6pcZpRwAM0AOopCQKAc0ABIHWgHIpGXJ69q/layPSgBAMmv6pwc0h5BGaAMHrQA6ikJxQDmgD+VgDNf1TZzmv5WhwelKeBjH50AJ61/VN1phHPev5XCeelACV/VOe9fysV/VOe9AH8rB60UHrRQAAZNf1Tg5oIJBGaQLg0AKSB1oByKaw5z7dK/lbPXpQB/VPX8q/XFf1T5r+VrGKAG4oIwa/qlOev6V/K2Rz0/KgD+qeiiigAooooAKKKKAE71/KxX9U/ev5WKAP6pzzQBiv5WKKAP6p8ewox7Cv5WKKAP6pySBnGa/lZIxg+9IDg0ZJNAH9U46UtIOlLQB/KvmlBJpKB1oAdjvmmng9a/qnxmv5WCc0AKOvWv6pFPP9acRkUYAFADSxB6V/K2QPWj1r+qbpQB/KwOT1p2O+aaDiv6p8YoA/lZ6V/VMBiv5WfWv6p6AEI46V/K12z61/VKRkYNAGKAP5WxyK/qjHTpS96/lY60ALgetf1SbsnGPxpxGRRtHpQB/K1tHX3ppGDX9U5Ar+VgnNAH9U9FfysUUAf1TMecYpQOOlfysA1/VOBigD+Vkdetf1SA896cRkUYAFACYz1pQMdq/lYPWigD+qiiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD/9k=" alt="" width="178" height="178" />

---------------------------------------------------------------------------------------------------

1:准备:jdk1.8(环境变量配置)等;IDEA(开发工具);GIT(版本控制器);maven(项目构建工具);PostgreSQL(数据库);

安装过程略(如果感兴趣可以加Ninja的QQ新群:262296156或者2群:560927314)

访问ninja官网实在太慢了,于是我把整个网站抓下来了,已经分享到群里了,需要的可以直接下载

--------------------------------------------------------------------------------------------------

2:直接创建一个Ninja项目官网位置:www.ninjaframework.org/documentation/getting_started/create_your_first_application.html

------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------

直接进行maven构建;

mvn archetype:generate -DarchetypeGroupId=org.ninjaframework -DarchetypeArtifactId=ninja-servlet-archetype-simple

解释一下这句话:我们使用maven构建项目,那就用它构建一个ninja原型--maven原型构建;

在你的某个目录下使用git窗口执行上面的代码,项目自动构建完毕(交互部分窝用中文解释一下);

$ mvn archetype:generate -DarchetypeGroupId=org.ninjaframework -DarchetypeArtif
actId=ninja-servlet-archetype-simple
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources
@ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources
@ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom --
-
[INFO] Generating project in Interactive mode
[INFO] Archetype [org.ninjaframework:ninja-servlet-archetype-simple:6.0.0-rc1] f
ound in catalog remote
Downloading: https://repo.maven.apache.org/maven2/org/ninjaframework/ninja-servl
et-archetype-simple/6.0.0-rc1/ninja-servlet-archetype-simple-6.0.0-rc1.jar
Downloaded: https://repo.maven.apache.org/maven2/org/ninjaframework/ninja-servle
t-archetype-simple/6.0.0-rc1/ninja-servlet-archetype-simple-6.0.0-rc1.jar (13 KB
 at 2.8 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/ninjaframework/ninja-servl
et-archetype-simple/6.0.0-rc1/ninja-servlet-archetype-simple-6.0.0-rc1.pom
Downloaded: https://repo.maven.apache.org/maven2/org/ninjaframework/ninja-servle
t-archetype-simple/6.0.0-rc1/ninja-servlet-archetype-simple-6.0.0-rc1.pom (3 KB
at 5.1 KB/sec)
Define value for property 'groupId': : Define value for property 'artifactId': : Define value for property 'version':
1.0-SNAPSHOT: : Define value for property 'package':  : : [WARNING] Archetype is
 not fully configured
Define value for property 'groupId': : Define value for property 'artifactId': :
 [INFO] Using property: version = 1.0-SNAPSHOT
Define value for property 'package':  : : cmy //这里是packeage的名字,你可以自己定义
[WARNING] Archetype is not fully configured
Define value for property 'groupId': : cmy    
 <!-- 构件的标识符,它和group ID一起唯一标识一个构件。换句话说,你不能有两个不同的项目拥有同样的artifact ID和groupID;
在某个 特定的group ID下,artifact ID也必须是唯一的。构件是项目产生的或使用的一个东西,
Maven为项目产生的构件包括:JARs,源 码,二进制发布和WARs等。--> 
Define value for property 'artifactId': : cmy
[INFO] Using property: version = 1.0-SNAPSHOT //这里是 打包后的版本
[INFO] Using property: package = cmy          //这里是packeage的名字,你可以自己定义
Confirm properties configuration:
groupId: cmy
artifactId: cmy
version: 1.0-SNAPSHOT
package: cmy
 Y: : y
[INFO] -------------------------------------------------------------------------
---
[INFO] Using following parameters for creating project from Archetype: ninja-ser
vlet-archetype-simple:6.0.0-rc1
[INFO] -------------------------------------------------------------------------
---
[INFO] Parameter: groupId, Value: cmy
[INFO] Parameter: artifactId, Value: cmy
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: cmy
[INFO] Parameter: packageInPathFormat, Value: cmy
[INFO] Parameter: package, Value: cmy
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: cmy
[INFO] Parameter: artifactId, Value: cmy
[INFO] project created from Archetype in dir: e:\_My_File_____\_work\MyCode\myCo
de\javaworkspace\A_myproject\cmy
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 09:57 min
[INFO] Finished at: 2017-03-13T15:44:03+08:00
[INFO] Final Memory: 16M/273M
[INFO] ------------------------------------------------------------------------

进入项目,安装一下maven依赖包:

cd cmy
mvn clean install // to generate the compiled classes the first time
mvn ninja:run // to start Ninja's SuperDevMode 运行项目

构建完毕:

我接手新项目习惯性研究一下包目录结构,那Ninja也有介绍,官方地址http://www.ninjaframework.org/documentation/getting_started/the_anatomy_of_a_ninja_application.html

如果有必要等抽空解释一下目录结构,暂时先放在这里如下:

 ├── pom.xml                                     // Instructions about dependencies and the build (Maven)
└── src
├── main
│ ├── java
│ │ ├── META-INF
│ │ │ └── persistence.xml // Contains informations how to access databases via JPA
│ │ ├── assets // Static assets of your application
│ │ │ └── css
│ │ │ └── custom.css
│ │ ├── conf
│ │ │ ├── Module.java // Dependency injection definitions via Guice (Optional)
│ │ │ ├── Routes.java // Contains all routes of your application in one location
│ │ │ ├── ServletModule.java // Integration of arbitrary servlet filters and mappings (Optional)
│ │ │ ├── StartupActions.java // Customization of application startup (Optional)
│ │ │ ├── application.conf // Configuration for test dev and production mode
│ │ │ ├── messages.properties // 18n messages
│ │ │ └── messages_de.properties
│ │ ├── controllers // Controllers will handle the actual request and do something
│ │ │ ├── ApiController.java
│ │ │ ├── ApplicationController.java
│ │ │ ├── ArticleController.java
│ │ │ └── LoginLogoutController.java
│ │ ├── dao // Database access via DAO objects and not in the controller
│ │ │ ├── ArticleDao.java
│ │ │ ├── SetupDao.java
│ │ │ └── UserDao.java
│ │ ├── db // Database migrations when dealing with RDBMS (Flyway)
│ │ │ └── migration
│ │ │ ├── V1__.sql
│ │ │ └── V2__.sql
│ │ ├── ehcache.xml // Configuration for ehcache
│ │ ├── etc
│ │ │ ├── LoggedInUser.java
│ │ │ └── LoggedInUserExtractor.java // Argument extractors for controller methods
│ │ ├── filters
│ │ │ └── LoggerFilter.java // Filter to filter the request in the controller
│ │ ├── logback.xml // Logging configuration via logback / slf4j
│ │ ├── models // Some models that map to your relational database
│ │ │ ├── Article.java
│ │ │ ├── ArticleDto.java
│ │ │ ├── ArticlesDto.java
│ │ │ └── User.java
│ │ └── views // html views - always map to a controller and a method
│ │ ├── ApplicationController
│ │ │ ├── index.ftl.html // Maps to controller "ApplicationController" and method "index"
│ │ │ └── setup.ftl.html
│ │ ├── ArticleController
│ │ │ ├── articleNew.ftl.html
│ │ │ └── articleShow.ftl.html
│ │ ├── LoginLogoutController
│ │ │ ├── login.ftl.html
│ │ │ └── logout.ftl.html
│ │ ├── layout
│ │ │ ├── defaultLayout.ftl.html
│ │ │ ├── footer.ftl.html
│ │ │ └── header.ftl.html
│ │ └── system // Error html views. Can be customized to output custom error pages
│ │ ├── 403forbidden.ftl.html
│ │ └── 404notFound.ftl.html
│ ├── resources
│ └── webapp
│ └── WEB-INF
│ └── web.xml // Needed for servlet containers to start up Ninja
└── test
├── java
│ └── controllers // Different tests for your application
│ ├── ApiControllerDocTest.java
│ ├── ApiControllerDocTesterTest.java
│ ├── ApiControllerMockTest.java
│ ├── ApiControllerTest.java
│ ├── ApplicationControllerFluentLeniumTest.java
│ ├── ApplicationControllerTest.java
│ ├── LoginLogoutControllerTest.java
│ └── RoutesTest.java
└── resources
└── test_for_upload.txt

好了,接下来就开始配置项目了:

我要开发的是一个简单的博客系统,运行在互联网上的项目,因此一个配置或者布局构架等等和业务系统有所区别;

项目分析:

前台:需要文章列表就可以,我希望最好有个主页进入

后台:管理页面(我初步设置两三种权限,系统管理员,博主后台,运营后台)

--------------------------------------------------------------------------

开始配置application.conf 文件:

java_Ninja实战过程的更多相关文章

  1. MySQL数据库主从同步实战过程

       Linux系统MySQL数据库主从同步实战过程 安装环境说明 系统环境: [root@~]# cat /etc/redhat-release CentOS release 6.5 (Final) ...

  2. ORACLE11g 没有控制文件如何通过rman备份恢复数据的详细实战过程

    1.副总裁需要裸恢复的严峻现实 集团总部的信息部负责人给我打电话说为了找一年前的记录,所以需要对一年前2015年5月1日的数据进行恢复.而2016年初因为进行迁移,所以有些文件可能丢失,手上只有rma ...

  3. s11 Docker+DevOps实战--过程和工具

    开发人员本地提交代码,本地使用容器模拟生产环境测试,测试通过提交到git master 分支,就会触发pipeline执行集成构建.集成工具: gitlab-vi,travis,或Jenkins.自动 ...

  4. 基于redis排行榜的实战总结

    前言: 之前写过排行榜的设计和实现, 不同需求其背后的架构和设计模型也不一样. 平台差异, 有的立足于游戏平台, 为多个应用提供服务, 有的仅限于单个游戏.排名范围差异, 有的面向全局排名, 有的只做 ...

  5. swift项目实战FoodPin目录

    好吧,据说写博客能够找到好工作,那我也来分享一个项目吧! 自己自学iOS开发也有半年多了,现在就来分享一个swift的小项目吧!这个项目的来源是<Beginning iOS8 programmi ...

  6. pxe网络安装操作系统 原理与详细过程

    摘要:在实际工作中,我们经常会遇到这样的情况:想要安装Linux但是计算机不带光驱或软驱,或者是笔记本配置的非标准的软驱和光驱,如1394接口,USB接口等,在Linux安装时所引导的Linux内核一 ...

  7. 实战经验丨CTF中文件包含的技巧总结

    站在巨人的肩头才会看见更远的世界,这是一篇技术牛人对CTF比赛中文件包含的内容总结,主要是对一些包含点的原理和特征进行归纳分析,并结合实际的例子来讲解如何绕过,全面细致,通俗易懂,掌握这个新技能定会让 ...

  8. ProxySQL+Mysql实现数据库读写分离实战

    ProxySQL介绍 ProxySQL是一个高性能的MySQL中间件,拥有强大的规则引擎.具有以下特性:http://www.proxysql.com/ 1.连接池,而且是multiplexing 2 ...

  9. Mongodb 集群实战

    该实战过程完全跟着官网一步一步实现 ,官网教程:https://docs.mongodb.com/manual/tutorial/atlas-free-tier-setup/ 使用Mongo Shel ...

随机推荐

  1. Mybaits的特点及优点

    1.SQL语句和代码分离 便于统一管理和维护,不必再Java代码中调式SQL语句.但是当SQL语句出错时,控制台不会打印Log, 解决办法--引用log4j 2.用标签拼接SQL语句 用标签代替JAV ...

  2. MySQL日期函数的用法几则

    1.将Date类型变成年月日时分秒的形式 select date_format(claimDate,'%Y-%m-%d %H:%i:%s') as claimdate from t1 2.只要年月日的 ...

  3. 【Unity】脚本选择打勾的勾选框隐藏

    这个问题事实上已经遇到过好几次了.但又没有特别的须要手动勾选,所以也一直都没在意. 今天研究了一下,原来是由于我删除了Start方法...... 所以.仅仅要脚本中没有Start方法,勾选框就会隐藏掉 ...

  4. google兴趣点下载工具

    继上次百度兴趣点版本的发布以后,发现百度只能下载本国数据,并且数据完整度还是和google的少一些,所以本次经过钻研与解密,实现了google地图下载工具,版本的主要功能如下: 1.支持多线程下载,支 ...

  5. javascript - 活动倒计时(天、时、分、秒)

    计数时: 结束时: 示例: <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...

  6. 【VAB】获取库文件地址

    如何获取Excle库文件地址呢?具体代码如下: Public Sub 获取Excel库文件夹的路径() MsgBox "库文件夹的路径是: " & Application. ...

  7. unsigned int与int相加问题

    作者 : 卿笃军 一道unsigned int与int类型的相加题目.引发了我对这个问题的思考. 首先要明确两个问题: 问题一. unsigned int 和 int究竟哪个能表达出来的数上限大呢? ...

  8. C#代码用法

    1.new的用法using System;using System.Collections.Generic;using System.Text;namespace yanz{public class ...

  9. oracle如何进行索引监控分析和优化

    在生产环境.我们会发现: ① 索引表空间 I/O 非常高     ② "db file sequential read" 等待事件也比较高   这种迹象表明.整个数据库系统.索引的 ...

  10. 初始化map和list的两种写法

    第一种方法(常用方法): //初始化List List list = new ArrayList(); list.add("string1"); list.add("st ...