原创 java 生成圖片驗證碼

import javax.imageio.ImageIO; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.image.BufferedI

原创 使用velocity 和 thymeleaf模板引擎編譯模板

在項目中會經常用到用模板編譯文件,本文使用velocity 和 thymeleaf編譯模板 在編譯javascript時使用 thymeleaf 編譯會出現變量中文會被轉成unicode編碼,在編譯完後使用轉碼進行轉碼   impor

原创 bootstrap form validate

bootstrap form validate /**  * 必填項,空格不行  */ jQuery.validator.addMethod("required2", function(value, element, param)

原创 docker 遇見問題記載及處理

一、docker 使用nginx做反向代理 1、failed (113: No route to host) while connecting to upstream nginx 配置: server { listen

原创 shedlock + redis 實現分佈式定時任務鎖

    在多服務中,經常會碰到定時調度會重複執行,避免定時調度重複執行,有好幾種方案,Elastic-Job,XXL-JOB Quartz:Java事實上的定時任務標準。但Quartz關注點在於定時任務而非數據,並無一套根據數據處理而定製

原创 RedisTemplate 幫助類

1、依賴 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</

原创 HttpAsynClient 使用

1、引入maven依賴 <!-- httpclient - httpasyncclient --> <dependency> <groupId>org.apache.httpcom

原创 java正則表達式

1、包含{{ cart.total_price }},不包含 minus: Pattern.compile("(\\{\\{\\s*cart.total_price\\s*\\|*(?!.*minus:)[^\\}\\}]*\\}\\}

原创 springboot 配置 jjwt

JWT 全名 JSON WEB Token 主要作用爲用戶身份驗證, 廣泛應用與前後端分離項目當中.     JWT 的優缺點 : https://www.jianshu.com/p/af8360b83a9f   一、pom.xml 引入

原创 git 常用命令

一、克隆遠程庫 克隆遠程庫 git clone git@**.git 拉取遠程庫所有分支,可以通過git branch -a  查看分支,然後檢出指定分支 git checkout develop 檢出develop分支   克隆遠

原创 mysql中url時區的陷阱該如何規避詳解

最近在工作中發現一個問題,是關於mysql中url時區的,發現這個陷阱如果大家不注意可能都會遇到,所以給大家總結下,這篇文章主要給大家介紹了關於mysql中url時區的陷阱該如何規避的相關資料,需要的朋友可以參考借鑑,下面來一起看看吧。

原创 mybatis + ehcache 配置

mybatis + ehcache 配置 1、引入ehcache jar包,pom.xml添加 <dependency> <groupId>net.sf.ehcache</groupId> <artifa

原创 springboot 配置多環境使用yml配置 @profileActive@ 啓動報錯Do not use @ for indentation

yml配置文件中添加了下面配置 spring: profiles: active: @profileActive@ 啓動會報錯:@profileActive@ 啓動報錯Do not use @ for indentatio

原创 sprinboot mybatis使用繼承AbstractRoutingDataSource獲取多數據源

sprinboot mybatis使用繼承AbstractRoutingDataSource獲取多數據源 AbstractRoutingDataSource:這個類是實現多數據源的關鍵,他的作用就是動態切換數據源,實質:有多少個數據源就存

原创 springboot mybatis 配置多數據源

1、在application.properties添加數據源配置 # 配置多數據源 spring.datasource.db1.url=jdbc:mysql://127.0.0.1:3306/test1 spring.datasourc