原创 spring security options請求返回403

springboot項目集成了spring security,對於跨域訪問發起的options請求,會返回403,原因是security默認不允許options請求,需要做以下修改: 第一種方式:忽略options請求      web.

原创 virtualbox make sure the kernel module has been loaded successfully

電腦異常關機後,virtualbox無法重新打開,報錯如下:     不能爲虛擬電腦 ubuntu 打開一個新任務. The virtual machine 'ubuntu' has terminated unexpectedly d

原创 window history pushState replaceState 跳轉原理

一、pushState  比如,當前打開的界面是:https://developer.mozilla.org/en-US/docs/Web/API/History,如下圖所示: 在chrome的console下,執行代碼: histo

原创 通過createElement創建html元素

創建link元素,併爲起指定href、rel屬性,並將其插入到head中 var common = document.createElement('link'); common.href="http://test.com/css/com

原创 js阻止表單提交的兩種方法

下面直接看代碼。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</tit

原创 阻止a標籤冒泡、默認行爲

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.

原创 Spring的Interceptor和Servlet的Filter區別

1.攔截器和Filter區別 2.SpringMVC配置前端控制器 在web.xml中配置 3.SpringMVC工作流程: 核心架構的具體流程步驟如下: 1、首先用戶發送請求——>DispatcherServlet,前端控制器收到請

原创 fatal: bad revision '121bc2d1236'

git 倉庫下有A、B兩個分支,假如A分支下有一個提交,該commit對應的id爲:'121bc2d1236',現在需要將該commit合併到B分支下,命令如下: 假如本地只有B分支對應的代碼,如果執行以下命令: git cherry-p

原创 HTML Entity 字符實體(字符轉義)

目錄 1. HTML Entity 2. 字符與Entity Name的互相轉換 3. 字符與Entity Number的互相轉換   1. HTML Entity 1.1 介紹 在編寫HTML頁面時,需要用到"<"、">"、"空格"等符

原创 HTTP協議header中Content-Disposition中文文件名亂碼

在做文件下載時,當文件名爲中文時,經常會出現亂碼現象。 參考文章: http://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/ 本文就

原创 Spring過濾器和攔截器執行流程

1. 幾種組件介紹 dangdangdang.jpg 1.1. 監聽器Listener Listener 可以監聽 web 服務器中某一個 事件操作,並觸發註冊的 回調函數。通俗的語言就是在 application,session,re

原创 List of Chromium Command Line Switches

詳情請轉到原文:https://peter.sh/experiments/chromium-command-line-switches/ There are lots of command lines which can be used

原创 取消鼠標的滾輪事件的默認行爲

需求是這樣的,有一個元素,比如div,通過鼠標滾動,實現該元素包含圖片的放大縮小,即:在該元素上滾動鼠標滾輪,則滾動效果只在該元素上起作用,而不影響界面(即瀏覽器)的滾動條。 何爲滾輪事件的默認行爲:      解釋:在某個元素上滾動鼠標

原创 SCRIPT12017: SCRIPT12017: WebSocket Error: SECURITY_ERR, Cross zone connection not allowed

Internet Zones (MSIE and Edge) Internet Explorer and Edge both disallow web socket connections between “internet zones”

原创 Uncaught DOMException: Blocked a frame with origin "" from accessing a cross-or

iframe跨域訪問時,如果訪問了被嵌入的界面中的dom信息,則會報錯。 案例: 比如:a.html,訪問地址爲http://test.com/index.html,頁面內容如下: <!DOCTYPE html> <html lang=