# 快速开始
# 创建项目(IDEA)
第一步:打开 IntelliJ IDEA 创建 maven 项目或者模块
第二步:修改项目 Maven 依赖配置,在 pom.xml 里添加最新jweb-boot依赖:
<dependency>
<groupId>cc.jweb</groupId>
<artifactId>jweb-boot</artifactId>
<version>1.0.3</version>
</dependency>
1
2
3
4
5
2
3
4
5
第三步:创建控制类 IndexController.java
import cc.jweb.boot.app.JwebApplication;
import cc.jweb.boot.controller.JwebController;
import io.jboot.web.controller.annotation.RequestMapping;
@RequestMapping(value = "/")
public class IndexController extends JwebController {
public static void main(String[] args) {
JwebApplication.main(args);
}
public void index() {
renderText("Hello World Jweb boot!");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
第四步:运行配置
- 右键编辑运行配置
- 指定匹配的工作目录(idea环境下,多module下这个目录会不准确,请留意)
第五步:运行
Connected to the target VM, address: '127.0.0.1:18204', transport: 'socket'
Jweb reset JFinal -> UndertowConfig -> PropExt -> classLoaderKit: cc.jweb.boot.kit.JwebClassLoaderKit@7e0b0338
Jweb reset JbootConfigManager properties!
Jweb reset JFinal -> UndertowConfig -> classLoaderKit: cc.jweb.boot.kit.JwebClassLoaderKit@6ef888f6
____ __ __ ___ ____
| || |__| | / _]| \
|__ || | | | / [_ | o )
__| || | | || _]| |
/ | || ` ' || [_ | O |
\ ` | \ / | || |
\____j \_/\_/ |_____||_____| BASE ON JBOOT
JbootApplication { name='jboot', mode='dev', version='3.8.1', config='cc.jweb.boot.core.JwebCoreConfig' }
JbootApplication ClassPath: /F:/DATA/jweb-boot/target/test-classes/
Starting JFinal 4.9.06 -> http://localhost:8080
Info: jfinal-undertow 2.4, undertow 2.0.33.Final, jvm 1.8.0_191
Jweb Scan ClassPath: F:/DATA/jweb-boot/target/classes
Jweb Scan ClassPath: F:/DATA/jweb-boot/target/test-classes
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/com/googlecode/concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.4.2/concurrentlinkedhashmap-lru-1.4.2.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.21.Final/hibernate-validator-6.0.21.Final.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/org/mindrot/jbcrypt/0.4/jbcrypt-0.4.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/io/jboot/jboot/3.8.1/jboot-3.8.1.jar
Jweb Scan Jar: C:/Users/ndasec/.m2/repository/org/reflections/reflections/0.9.12/reflections-0.9.12.jar
Jweb Scanning SqlTemplate Resouce: []
一月 28, 2021 2:43:08 下午 com.jfinal.core.paragetter.ParaProcessorBuilder warn
警告: You should config compiler argument "-parameters" for parameter injection of action : cc.jweb.boot.test.index.controller.IndexController.main(...)
Visit https://jfinal.com/doc/3-3 for details
Jweb Discovery disabled!
一月 28, 2021 2:43:08 下午 io.undertow.Undertow start
INFO: starting server: Undertow - 2.0.33.Final
一月 28, 2021 2:43:08 下午 org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
一月 28, 2021 2:43:08 下午 org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
Starting Complete in 4.4 seconds. Welcome To The JFinal World (^_^)
Jweb Started! Visit http://localhost:8080
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
第六步:访问 通过浏览器访问 http://localhost:8080 (opens new window) ,将返回相应文本信息即为成功!