1:sublime 格式化代碼:java
全選-- 編輯--行列--從新縮進web
2:關於項目目錄結構的一些總結:redis
方框裏面的都是虛擬的類路徑,編譯成class文件之後,在classes目錄下:以包名來展現:服務器
3:獲取配置文件: app
privatestatic Properties properties = new Properties();eclipse
static {maven
InputStream in = PropertiesUtil.class.getResourceAsStream("/config.properties");ide
try {spa
properties.load(in); 3d
} catch (IOException e) {
e.printStackTrace();
}
}
publicstatic String get(String key) {
String value = properties.getProperty(key);
if(value != null){
value = value.trim();
}
return value;
}
4:關於引入的js報錯問題:
5:redis存儲分目錄結構:使用冒號分割
6:接口的實現類 寫個接口的實現類,在方法的前面加了@Override竟然報錯
緣由是:@Override是JDK5就已經有了,但有個小小的Bug,就是不支持對接口的實現,認爲這不是Override 而JDK6修正了這個Bug,不管是對父類的方法覆蓋仍是對接口的實現均可以加上@Override。
首先要確保安裝了jdk 1.6,
而後,在eclipse中修改配置,在 Windows->Preferences-->java->Compiler-->compiler compliance level 中選擇 1.6,刷新工程,從新編譯下。
若是仍是不行,就在報錯的工程上,鼠標右鍵選擇 Properties-->Java Compiler-->compiler compliance level 中選擇 1.6,刷新工程,從新編譯下。
7:新建maven-web項目的時候默認是不會建立這幾個源文件夾的:今天偶然發現若是在項目的的運行時環境加上服務器的環境就會自動生成了: