原创 下載靜態文件

//下載文件 @RequestMapping("downloadDemo") @ResponseBody public synchronized void downloadDemo(HttpServletRequest requ

原创 jquery操作checkbox、radio 和 ul

1.html <!-- checkbox --> <input class="cb" id="id1" type="checkbox" value="1"/>1 <input class="cb" id="id2" typ

原创 tab樣式點擊切換按鈕

1.css <style type="text/css"> .tog{ background-color: rgb(70, 130, 180); color:white; width: 100%; font-si

原创 sql分組 case條件查詢

1.首先建表,插入數據 DROP TABLE IF EXISTS `aa`; CREATE TABLE `aa` ( `id` int(255) NOT NULL AUTO_INCREMENT, `user` varcha

原创 spring boot對外部文件的訪問

很多朋友都會遇到這個問題,項目打包成jar格式,本地其他盤符裏面的文件訪問不到(項目達成war包的和資源是在服務器訪問的請忽視),這裏只需要在配置文件中添加配置,然後使用建立一個WebMvcConfigurerAdapter攔截就

原创 linux啓動spring boot項目

這裏舉例打包爲jar後綴的spring boot項目,如果是war包則使用tomcat,將war包放入到webapps文件夾下面,然後啓動tomcat即可 1.編輯boot.sh腳本 #!/bin/bash nohup java

原创 Java下載自定義的excel文件

  java下載自定義的excel文件 public void downloadFile(HttpServletRequest request, HttpServletResponse response) throws IOExcept

原创 spring boot編寫post接口中文亂碼問題

1.後臺代碼 import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariabl

原创 java調用http接口的兩種方式

1.get方式 private void httpURLGETCase() { String methodUrl = "http://xx.xx.xx.xx:8086/sp-test/usertest/query"

原创 StringUtils.isBlank判斷空字符串

import org.apache.commons.lang.StringUtils; public class Util { public static void main(String[] args) {

原创 java Calendar獲取當前時間

獲取系統當前時間戳 public static void main(String[] args) { Calendar cal=Calendar.getInstance(); int year = cal.get(C

原创 非controller裏調用service接口方法

1.首先非controller類使用@Component實例化到spring容器中 2.定義@PostConstruct的初始化方法 舉例 import javax.annotation.PostConstruct; import org

原创 jquery判斷是否包含字符串

1.html <p>123errie</p> 2.js var a = $("p").text(); $("p").click(function(){ if(a.indexOf("errie")==-1){

原创 spring cloud概念總結

1.eureka(註冊與發現) Eureka是由Netflix(公司)開發的服務發現框架,本身是一個基於RESTful的服務,主要用於定位運行在亞馬遜域中的中間層服務 由兩個組件組成:Eureka Server和Eureka C

原创 jquery點擊返回頁面頂部

1.html <div id='returnTool'>返回頂部</div> 2.css (將returnTool層至於頁面底部固定不動) <style type="text/css"> #returnTool { posi