原创 springboot——設置默認首頁
最近基於前後端分離方式開發一個系統,前端同事編譯出來的代碼在dist/*目錄下,而實際上希望訪問系統地址的時候直接跳轉到dist/index.html下,現需要做如下修改: @Configuration public class
原创 springboot——security基於內存的多用戶支持
一、pom.xml配置 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-st
原创 springboot-指定profile啓動
spring boot項目可爲不同的環境配置相應的配置文件 spring: datasource: db-name: sm profiles: active: @spring.active@ --- sp
原创 springboot——security基於自定義數據庫模型的認證
一、Maven配置 本示例基於security5 + mybatis-plus + lombok <dependencies> <dependency> <groupId>org.springframework.boot</
原创 springboot-PropertySource無法加載yaml解決辦法
@PropertySource只對properties文件可以進行加載,但對於yml或者yaml不能支持。 // 繼承DefaultPropertySourceFactory public class YamlAndPropert
原创 springboot——集成redis cache
一、pom.xml配置 <dependencies> <dependency> <groupId>org.springframework.boot</groupId>
原创 springboot——security基於Jdbc的多用戶支持
一、pom.xml配置 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-st
原创 springboot——security使用JSON登錄
一、pom.xml配置 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-st
原创 java.lang.StackOverflowError——因爲設置Xss不恰當而導致的虛擬機棧溢出
一、問題現象 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'excelResultManager'
原创 排序算法——簡單排序算法
一、算法原理 通過N-1次遍歷,從a[i+1] ~ a[n-1]中選擇出最小的數a[j]將這個數設置到i位置。 二、算法分析 以數組{9,1,5,8,3,7,6}爲例 第一輪 i = 0,從{9,1,5,8,3,7,6}中找出最
原创 Jersey——基本認證 & 摘要認證 & 表單認證
一、準備工作 Spring5.1.7 + Jersey2.27 + Tomcat環境搭建 創建spring+jersey的maven項目依賴如下: <dependencies> <dependency>
原创 Java8 CompletableFuture與ThreadPoolTaskExecutor實踐
一、CompletableFuture介紹 Jdk8 CompletableFuture提供了新的異步編程思路,可以對多個異步處理進行編排,實現更復雜的異步處理。其內部使用ForkJoinPool實現異步,使用Completabl
原创 Java8 Stream流使用
一、簡述 Java 8 中的 Stream 是對集合(Collection)對象功能的增強,它專注於對集合對象進行各種非常便利、高效的聚合操作(aggregate operation),或者大批量數據操作 (bulk data o
原创 springboot——security實現驗證碼:使用自定義認證
在使用Spring Security的自定義認證之前,有必要了解Spring Security是如何靈活集成多種認證方式的。在spring Security中用戶被稱爲主體(principal),主體包含了所有能夠驗證而獲得系統訪
原创 springboot——security實現驗證碼:自定義過濾器
驗證碼(CAPTCHA)的全稱是Complete Automated Public Turing test to tell Computers And Humans Apart,翻譯過來就是“全自動區分計算機和人類的圖靈測試”。通