Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Architecture & Framework  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
话题被移动
该话题已被移动 - floater , 2004-06-16 01:58
如果您尚不清楚该话题被移动的原因,请参考论坛规则以及本版公告或者联系本版版主。
作者 Re:J2EE交流贴 [Re:jigsaw]
hitaco





发贴: 432
积分: 31
于 2004-06-17 10:13 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
I am afraid most applications(at least in my company), will not do anything other than a friendly UI when SQLExceptino occur, so, there is no need to wrap/rethrow the SQLException. Something like exception handler in Struts or declarative exception configuration in web.xml is enough, that means, we can use generic means to catch/handle exception rather than duplicating the "try/catch/forward to error page" logic everywhere in the source code.

Of course, what kind of exception to use should be taken into consideration in serious project.

jigsaw wrote:
to hitaco abt exceptions:
no matter DAO/EJB throws RuntimeException or checked exception,
client class is expected to catche them, since exceptions are return from method.
However SQLException contains not enought infos abt wot's happening,
so we have to wrap it w/ app-spec exception to tell client class wot's
going on there.
if a wrapper of low level exception is not able to tell in a non-ambiguous way, it should be defined as a runtime exception which means client dont have to catch it, just let CMT to rollback and display a common error message to end user.




话题树型展开
人气 标题 作者 字数 发贴时间
25017 [精华] J2EE交流贴 Jove 129 2004-06-15 16:11
21283 Re:J2EE交流贴 jfml 15 2004-06-15 16:16
21148 Re:J2EE交流贴 floater 3646 2004-06-16 22:39
21146 Re:J2EE交流贴 hitaco 1731 2004-06-16 23:17
21275 Re:J2EE交流贴 jigsaw 573 2004-06-17 09:36
21143 Re:J2EE交流贴 hitaco 1161 2004-06-17 10:13
21202 Re:J2EE交流贴 jigsaw 335 2004-06-17 09:44
21203 Re:J2EE交流贴 floater 322 2004-06-17 10:00
21195 Re:J2EE交流贴 floater 69 2004-06-17 10:13
21187 Re:J2EE交流贴 chenyajun5 21 2004-06-17 11:16
21172 Re:J2EE交流贴 zyzhang 1828 2004-06-17 22:04
21153 Re:J2EE交流贴 floater 460 2004-06-18 09:22
21249 Re:J2EE交流贴 Jove 617 2004-06-18 10:24
21093 Re:J2EE交流贴 floater 1158 2004-06-18 13:50
21152 Re:J2EE交流贴 Jove 308 2004-06-18 14:48
21225 Re:J2EE交流贴 nothing 4 2004-06-15 16:34
21100 Re:J2EE交流贴 floater 431 2004-06-18 21:32
20997 Re:J2EE交流贴 zyzhang 3887 2004-06-22 01:48
22619 Re:J2EE交流贴 zhbk 10 2004-07-30 14:58
21059 Re:J2EE交流贴 winconcom 23 2004-09-09 11:45
21435 Re:J2EE交流贴 jigsaw 55 2004-06-15 16:57
21376 Re:J2EE交流贴 wes109 0 2004-06-15 17:21
21326 Re:J2EE交流贴 wes109 25 2004-06-15 17:34
21325 Re:J2EE交流贴 zyzhang 412 2004-06-15 18:14
21982 Re:J2EE交流贴 floater 3201 2004-06-16 03:05
21220 Re:J2EE交流贴 jigsaw 4037 2004-06-16 13:45
21094 Re:J2EE交流贴 zyzhang 5937 2004-06-16 19:44
21303 Re:J2EE交流贴 Jove 357 2004-06-16 14:31
21220 Re:J2EE交流贴 Jove 136 2004-06-17 10:04
21241 Re:J2EE交流贴(2nd rar) Jove 58 2004-06-17 10:06

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923