前后端很容易因為編碼的問題引起亂碼 所以一定要搞清charset的幾個值
| charset=iso-8859-1 | 西歐的編碼,英文編碼 |
| charset=gb2312 | 中文編碼 |
| charset=utf-8 | 世界通用語言編碼 |
| charset=big5 | 繁體中文編碼 |
| charset=euc-kr | 韓文編碼 |
其次說一下meta元數據標簽里的各個屬性值
他所提供的信息用戶不可見 其中兩個比較重要的屬性是http-equiv 和 name(頁面描述信息) content內容
<meta name="參數" content="具體參數值">
Keywords關鍵字 告訴搜索引擎網頁的關鍵字是什么
<meta http-equiv="content-Type" content=text/html;charser=gb2312/>
driver=ResourceBundle.getBundle("db").getString("driver");
解釋:通過ResourceBundle,我們需要訪問位于/WEB-INF/classes目錄下的一個后綴名為properties的文本類型文件,從里面讀取我們需要的值。
Locale locale = Locale.getDefault(); ResourceBundle localResource = ResourceBundle.getBundle("ConnResource", locale); String value = localResource.getString("test"); System.out.println("ResourceBundle: " + value);
這里對應了/WEB-INF/class/ConnResource.properties文件內容為: test=hello world 打印出來的結果就是hello world
解決:Duplicate entry '0' for key 'user.PRIMARY'
1:設置字段id為自增長:create table user(id int primary auto increament)
2:注解

浙公網安備 33010602011771號