原创 jsp A標籤中文excel文件下載報404,無法下載

解決方法:在tomcat的server.xml文件中添加  URIEncoding="UTF-8" <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1"

原创 go 操作mysql、增刪改查

MySQL驅動 Go中支持MySQL的驅動目前比較多,有如下幾種,有些是支持database/sql標準,而有些是採用了自己的實現接口,常用的有如下幾種: https://github.com/go-sql-driver/mysql 

原创 Go支持https協議的簡單例子

我們知道除了http方式訪問網頁之外,還有一種加密的https方式。Go語言的net/http包中包含了這種https頁面訪問方式的支持。net/http包中的ListenAndServeTLS就是提供這個功能的。我們可以先看一下這個函數

原创 java 中 解決回車鍵(\r\n)

今天由於項目部署的時候,輸入回車鍵不能轉義問題: 1,新建的頁面中,輸入詳情時關於回車鍵後臺接收的爲:\r\n的處理:describe.trim().toString().replaceAll("\r\n", "\\\\n") 2,修改頁

原创 GO標準庫概述

像 fmt、os 等這樣具有常用功能的內置包在 Go 語言中有 150 個以上,它們被稱爲標準庫,大部分(一些底層的除外)內置於 Go 本身。完整列表可以在 Go Walker 查看。 在貫穿本書的例子和練習中,我們都是用標準庫的包。可

原创 go interface 轉 string,解析json

package main import ( "encoding/json" "fmt" ) var user map[string]interface{} func main() { userJson := "{\"usern

原创 go int類型轉換string,通過反射類型對比

  1.在拼寫string時,下面這種寫法會報錯:mismatched types string and int func GetErrorJsonData(status int, msg string) string { jsons

原创 shell 操作tomcat.sh

<span style="font-size:24px;">tomcat.sh</span>#!/bin/bash #接收tomcat.sh所有傳遞的參數 param=$* #判斷輸入的參數不能爲空 if [ -z $param ] #判

原创 go語言 獲取post方式json

正在學習go語言,看了一段時間的文檔,想自己寫個服務器,在獲取接口數據的時候發現獲取數據,格式爲"form-data"的數據最簡單,</span> 傳入post json數據:{"username":"","password":"123

原创 shell 定時器

修改crontab的編輯方式VI:<span style="font-family: Arial, Helvetica, sans-serif;">EDITOR=vi</span>export EDITOR 1.Crontab是一個系統的

原创 Struts 2 接收post請求

BufferedReader br = new BufferedReader(new InputStreamReader((ServletInputStream)request.getInputStream(),"UTF-8"));

原创 Ubuntu下Sublime Text 3解決無法輸入中文的方法

本經驗目前在Ubuntu14.04環境下,已有搜狗輸入法 for Linux和Sublime Text 3的情況下安裝成功。 步驟閱讀 END 解決方法步驟2 保存下面的代碼到文件subl

原创 SSH所需的JAR包

來自:http://www.cnblogs.com/luoyun/archive/2013/01/03/2843353.html 一.Struts2 用的版本是struts2.3.1.1 一個簡單的Struts項目所需的jar包有

原创 java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor

錯誤描述: 使用Spring4.2集成hibernate4,在添加聲明式事務管理後,測試,發現拋出java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInte

原创 Expected MultipartHttpServletRequest: is a MultipartResolver configured?

Spring mvc 上傳多個文件問題: 1、文件上傳中from必須指定enctype="multipart/form-data",如:<formid="formImport"class="form-horizontal"enctype=