spring boot 计划任务

http 请求

经常需要发送一个 GET/POST 请求到其他系统(REST API),通过 JDK 自带的 HttpURLConnection、Apache HttpClient、Netty 4、OkHTTP 2/3 都可以实现。

表单验证

限制 说明

  • @Null 限制只能为 null
  • @NotNull 限制必须不为 null
  • @AssertFalse 限制必须为 false
  • @AssertTrue 限制必须为 true
  • @DecimalMax(value) 限制必须为一个不大于指定值的数字
  • @DecimalMin(value) 限制必须为一个不小于指定值的数字
  • @Digits(integer,fraction) 限制必须为一个小数,且整数部分的位数不能超过 integer,小数部分的位数不能超过 fraction
  • @Future 限制必须是一个将来的日期
  • @Max(value) 限制必须为一个不大于指定值的数字
  • @Min(value) 限制必须为一个不小于指定值的数字
  • @Past 限制必须是一个过去的日期
  • @Pattern(value) 限制必须符合指定的正则表达式
  • @Size(max,min) 限制字符长度必须在 min 到 max 之间
  • @Past 验证注解的元素值(日期类型)比当前时间早
  • @NotEmpty 验证注解的元素值不为 null 且不为空(字符串长度不为 0、集合大小不为 0)
  • @NotBlank 验证注解的元素值不为空(不为 null、去除首位空格后长度为 0),不同于@NotEmpty,@NotBlank 只应用于字符串且在比较时会去除字符串的空格
  • @Email 验证注解的元素值是 Email,也可以通过正则表达式和 flag 指定自定义的 email 格式

常用工具类

Thymeleaf 教程

<!DOCTYPE html>
<html lang="en" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html>

Spring Boot 教程

WEB 建站资料

开始建项目

添加依赖

web 参考资料

security

统一异常处理

jpa

mysql

thymeleaf

//pom.xml

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
    <thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
    <thymeleaf-extras-springsecurity4.version>3.0.2.RELEASE</thymeleaf-extras-springsecurity4.version>
</properties>
<dependencies>
    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-springsecurity4</artifactId>
    </dependency>
</dependencies>

//html
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
4 Standard Expression Syntax

Simple expressions:
Variable Expressions: ${...}
Selection Variable Expressions: *{...}
Message Expressions: #{...}
Link URL Expressions: @{...}
Fragment Expressions: ~{...}

Literals
Text literals: 'one text', 'Another one!',…
Number literals: 0, 34, 3.0, 12.3,…
Boolean literals: true, false
Null literal: null
Literal tokens: one, sometext, main,…

Text operations:
String concatenation: +
Literal substitutions: |The name is ${name}|

Arithmetic operations:
Binary operators: +, -, *, /, %
Minus sign (unary operator): -

Boolean operations:
Binary operators: and, or
Boolean negation (unary operator): !, not

Comparisons and equality:
Comparators: >, <, >=, <= (gt, lt, ge, le)
Equality operators: ==, != (eq, ne)

Conditional operators:
If-then: (if) ? (then)
If-then-else: (if) ? (then) : (else)
Default: (value) ?: (defaultvalue)
Special tokens:

No-Operation: _

autuator

devtools

其他参考资料

vaadin

window 查询端口调用

引用地址:http://blog.51cto.com/58582786/671487

当然前提是 cmd.exe 是以管理员身份执行的,不然会报“拒绝 xx”的错.....

1、netstat -ano |findstr 8088 //查看 8088 端口是否存在 记下最后一位数字,即 PID

2、tasklist |findstr 10152(PID 号)//查看 pid 为 10152 的是什么程序在用

3、taskkill /T /F /PID 10152 //强制(/F 参数)杀死 pid 为 10152 的所有进程包括子进程(/T 参数)

email:[email protected] all right reserved,powered by GitbookFile Modify: 2018-12-03 03:21:50

results matching ""

    No results matching ""