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

您没有登录

» Java开发网 » Java EE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 How to do with your java exception
isquare





发贴: 2
积分: 0
于 2005-07-13 18:06 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
各位,我想问问,你们是怎样处理java exception de,比如那些异常是给客户看的,那些是给不给用户看的,尤其牵涉到数据库层的exception是怎么处理,用什么方式抛出,抛出的异常是否有统一的页面来处理。说的详细点、


作者 Re:How to do with your java exception [Re:isquare]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2005-07-19 21:22 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
这东西应该自己设计,根据你的业务需要或维护需求来定!


"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:How to do with your java exception [Re:isquare]
jiyunang





发贴: 18
积分: 11
于 2005-07-20 07:49 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
一般自己做
一个SystemException extends Exception
一个ConditionException extends SystemException
给客户看的抛ConditionException
给自己看的抛SystemException
抛出的异常有统一的页面来处理,
ConditionException给客户一个错误的警告,信息。
SystemException给客户一个系统错误的信息。
牵涉到数据库层一般抛SystemException,
但根据业务需要,
比如数据没有整合的情况下,
可能要求抛ConditionException。
当然为了更好区别错误,
ConditionException可以是多种,
比如Condition1Exception输入错误,
Condition2Exception输出错误。
。。。。。。。。。
暂时想到这些。



作者 Re:How to do with your java exception [Re:jameszhang]
youlq



CJSDN高级会员


发贴: 260
积分: 95
于 2005-07-20 15:20 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
转一篇文章,也许有帮助:
Exception management and error tracking in J2EE
http://www.javaworld.com/javaworld/jw-07-2005/jw-0711-exception.html

Develop an exception framework for handling errors in the J2EE world

Summary
Think back on your last J2EE project. Did you encounter situations when errors were never logged—or logged more than once? Did you spend countless hours tracking down a bug, whose real cause was that someone swallowed an exception somewhere? Did your users see a stack trace? If so, chances are, you might need a common strategy for exception management and some complementing code. This article provides the basis for developing a set of policies along with a supporting framework for error handling in the J2EE world. (3,100 words; July 11, 2005)



Be tough!

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