原创 springboot 提示bean無法注入的問題

springboot在注入的時候提示 Unsatisfied dependency expressed through field 'deptService'; nested exception is org.springframewo

原创 List爲什麼不能一邊遍歷 一邊操作

1、對於ArrayList,在使用Iterator遍歷時,不能使用list.add()、list.remove()等改變list的操作,只能用it.remove() 原因是ArrayList不是線程安全的,需在單線程環境下使用,如

原创 hashmap和ehcahe的區別

而一個標準Cache的主要特徵有: 過期時間 容量規劃(重要) 清除策略(重要) 命中率統計 從以上條件看hash並不是一個很好的緩存容器,更多的考慮ehcahe等

原创 標籤中的name屬性和ID屬性的區別

編程這麼久,細想了一下,發現這個問題還不是很清楚,汗!看了幾篇文章,整理了一下,分享下!      一個朋友如是的說到“ID就像是一個人的身份證號碼,而Name就像是他的名字,ID顯然是唯一的,而Name是可以重複的”我感覺很貼切!【但是

原创 js構造函數和對象

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

原创 設計模式-總結

1.單例模式:懶漢,餓漢,加鎖,雙重判斷(加voletal),靜態內部類 2.工廠 3.靜態工廠 4.代理 5.裝飾器,區分代理和裝飾器,代理模式的類是內部創建好,裝飾器是外部傳入 6.觀察者模式 7.原型模式(實現clonable接口)

原创 restemplate發送安全認證的http請求

業務中,會訪問到需要安全認證的服務。如 發送請求時,需要把resttemplate設置頭信息,具體實現如下         String url = "http://localhost:8080/testController";   

原创 JoIntPoint常用方法

在常見的切面中,常用的參數有:JointPoint和ProceedingJoinPoint,其中ProceedingJoinPoint繼承JointPoint,ProceedingJoinPoint用在@Arround註解的方法參數裏,下

原创 mysql timestamp更新問題

1.timestap會自動更新,解決自動更新問題,只需要去掉對勾 2.tiemstamp的一些解釋 

原创 java 集合list轉數組的幾種方式

1.toArray eg: list.toArray(new String[list.size]) 這裏要注意list類型,和數組的類型是一致的,這裏我默認list是string,假如list是Integer類型,那就是list.toAr

原创 Java zip解壓工具類

分享一個自己用的zip工具類 public class ZipUtils { public static void unZip(File srcFile, String destDirPath) throws RuntimeExce

原创 shiro 源碼加密方式

/** * @description 源碼的加密方式 * @param args */ public static void main(String[] args) { // 加密的方式 String hashAl

原创 eureka集羣read timeout異常

eureka集羣后,啓動privder向eureka集羣註冊時,報錯   com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException

原创 冒泡排序

class demo { int temp; int a[]={0,1,2,3,4,5,6,7,8,9} public void maopao{ //n個數字只需要n-1次排序 for(int i

原创 蓄水池算法

此算法經常用於不知道總體規模有多大的時候,進行數據的抽樣,保證數據的公平性 public class ReservoirSamplingTest { private int[] pool; // 所有數據 privat