原创 文件下載

/** * 讀取配置文件 */ @Autowired private Environment environment; @GetMapping(value = "download") public void download

原创 生成一維碼與解析一維碼

maven引入 <!-- 一維碼或二維碼編碼 --> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <versi

原创 如何獲取泛型的類類型

ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass(); // 獲取第一個類型參數的真實類型 this.clazz = (

原创 Structs2中全局獲取request和response

獲取request 解耦 方式一 HttpServletRequest request = (HttpServletRequest)ActionContext.getContext().get(StrutsStatics.HTTP

原创 Spring MVC 如何全局獲取request和response

全局獲取request HttpServletRequest httpServletRequest = ((ServletRequestAttributes)RequestContextHolder.getRequestAttri

原创 IDEA的ctrl+c,ctrl+v等快捷鍵無法使用

因爲勾選了Vim模式, Tools,Vim Emulator,前面會有一個√,取消即可,如圖:

原创 windows桌面圖標或狀態欄圖標顯示空白或無法正常顯示

桌面圖標顯示空白 右鍵->屬性->快捷方式->更改圖標,選擇圖標的路徑,確定 狀態欄圖標顯示空白 win+R彈出運行窗口,輸入 %APPDATA%\Microsoft\Internet Explorer\Quick Launch\Us

原创 tomcat啓動控制檯中文亂碼

在tomcat啓動時會有中文亂碼問題,這是因爲tomcat與系統編碼不一致造成的 tomcat是utf-8,查看控制檯編碼發現是GBK,於是就亂碼了 解決辦法:進入tomcat目錄下的conf apache-tomcat-8.5.38

原创 一步一步學SpringBoot(三)---SpringBoot與德魯伊(Druid)的故事

添加依賴 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starte

原创 一步一步學SpringBoot(五)---SpringBoot整合Mybatis進行簡單的增刪改查

在pom文件引入依賴 前面已經引入了這些依賴,再確定一下 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artif

原创 一步一步學SpringBoot(二)---SpringBoot使用MybatisGenerator插件生成代碼

在pom.xml增加以下依賴 <!-- 以下這些可以新建項目的時候依賴,沒有引入版本號是因爲parent節點可以控制版本 --> <dependency> <groupId>org.mybatis.spring.boot</g

原创 Error creating bean with name 'userController' defined in file

出現 Error creating bean with name 'userController' defined in file [E:\IntelliJ\workspaces\web_workspaces\best_springb

原创 JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl] will not be managed by Spring

出現 SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@99362df] was not registered for synchronization b

原创 一步一步學SpringBoot(四)---德魯伊(Druid)對數據庫密碼加密

數據庫密碼加密 首先用命令行進入druid-1.1.0.jar所在的目錄 再執行以下命令運行代碼對密碼進行加密 輸入你的密碼 java -cp druid-1.1.0.jar com.alibaba.druid.filter.conf

原创 Could not autowire. No beans of '' type found. less... (Ctrl+F1) Checks autowiring problems in a be

啓動出現 Could not autowire. No beans of '' type found. less... (Ctrl+F1) Checks autowiring problems in a bean class 錯誤,網