1.保存時自動格式化代碼:
打開eclipse/myeclipse 選擇 window-->Preferences-->JAVA-->Editor-->Save Actions 右邊選中:
Perform the selected actions on save
Format source code
Format all lines
Organize imports
保存后重啟Myeclipse即可。
2.在jsp、xml、html中格式化代碼
右擊--->Sourse-->Format 即可,