文章列表
经常用 快捷键(红色标记)
- 博客分类:
- myeclipse
MyEclipse 快捷键1(CTRL)
-------------------------------------
Ctrl+1 快速修复
Ctrl+D: 删除当前行
Ctrl+Q 定位到最后编辑的地方
Ctrl+L 定位在某行
Ctrl+O 快速显示 OutLine
Ctrl+T 快速显示当前类实现类的继承结构
Ctrl+W 关闭当前Editer
Ctrl+K 快速定位到下一个
Ctrl+E 快速显示当前Editer的下拉列表
Ctrl+J 正向增量查找(按下Ctrl+J后,你所输入的每个字母编辑器都提供快速匹配定位到某个单词,如果没有,则在stutes lin ...
设置 代码 comments
- 博客分类:
- myeclipse
设置 代码 模板
preferences->java-> code style-> code Templates
选择 comments->Methods 点击 edit 加入下面 格式
如 :
/**
* (non-javadoc)
* @see ${enclosing_method}
* @author zsb(修改为自己名)
* @date ${date} ${time}
* @version V 1.0
* ${tags}
*/
1.方法 内不要超过 100行
2.不要有 if(true) aa; 修改为 if(true){ aa; }
也不要 if(aa==null&&aa.equals("")){} 修改为 if(aa == null && aa.equals("")){} 条件与条件之间加一个空格
3.在代码中 要经常判断一个对象是否为空,如 使用 对象.属性 时 加入判断 对象是不是为空 这个一定要判断
如果 这个对象为空 时 对下面的操作有影响 就手动 throw new Exception("描述");
4.在 ...
数据库查询的语句 都写在 dao 里,注(不要再写到 service,action 里)
在dao 写一个 大查询(方法包含所有model对象的所有属性),serice 用重写的方法 调用 dao
如 ServicelogExtraColumnDao
有一个方法
public List<ServicelogExtraColumn> getAllObject(Long operationId,String columnName,String displayName,Integer status,String systemId)
上面的参数都是 ServicelogExtraCo ...
一 strus2 定义
Action: XXXAction 如 orgAction
Xml 文件:
<package name="包.XXXAction" extends="default(不要用struts-default)" namespace="/文件存在路径(struts-config路径下)">
<action name="XXX!*" class="包.XXXAction" method="{1}">
<result name=&qu ...