天天看点

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

继续阅读