天天看點

SSH系列:(1)MyEclipse環境設定

1、切換workspace

操作:File-->Switch Workspace-->Other

2、Java環境設定

内容:修改Java編譯器版本、Java運作環境JRE、Tomcat伺服器

a)修改Java編譯器版本:Window-->Preferences-->Java-->Compiler

b)修改Java運作環境JRE:Window-->Preferences-->Java-->Installed JREs

c)添加Tomcat伺服器:Window-->Preferences-->MyEclipse-->Servers-->Tomcat

3、字元編碼設定

内容:修改workspace的字元編碼、修改project的編碼、修改JSP頁面的預設編碼

a)修改workspace的字元編碼:Window-->Preferences-->General-->Workspace-->Text file encoding

b)修改project的字元編碼:在項目上,單擊右鍵-->Properties-->Resource-->Text file encoding

c)修改JSP的預設編碼:Window-->Preferences-->MyEclipse-->Files and Editors-->JSP

4、界面顯示設定

a)工具欄按鈕和右鍵菜單設定:Window-->Customize Perspective-->Tool Bar Visibility 和 Shortcuts
b)修改Editor字型:Window-->Preferences-->General-->Appearance-->Colors and Fonts-->Basic-->Text Font,選擇“Courier New”或“Microsoft YaHei UI”或“Comic Sans MS”
c)修改Console字型:Window-->Preferences-->General-->Appearance-->Colors and Fonts-->Debug-->Console Font,選擇“Courier New”或“Microsoft YaHei UI”或“Comic Sans MS”

5、其它設定

a)運作前自動儲存:Window-->Preferences-->Run/Debug-->Launching-->Save required dirty editors before launching-->Always

b)類型轉換添加快捷鍵:Window-->Preferences-->General-->Keys-->Quick Fix-Add cast

c)修改Java代碼格式:Window-->Preferences-->Java-->Code Style-->Formatter-->Edit-->Braces 和 Control Statements

d)修改打開JSP的預設方式:Window-->Preferences-->General-->Editors-->File Associations 為*.jsp選擇MyEclipse JSP Editor

e)修改項目的釋出目錄:項目右鍵->Properties->MyEclipse->Web->Web Context-root

6、SSH開發順序

按照entity->dao->service->action->config的順序進行開發。

entity層的配置檔案包括Hibernate的映射檔案(*.hbm.xml)

dao、service層的配置檔案就是将它們注冊到Spring的IOC容器中

action的配置檔案包括Spring、Struts兩方面

最會要注意這些配置檔案要彙總到applicationContext.xml和struts.xml檔案中

ssh

繼續閱讀