如何屏蔽exception异常信息,后台不显示(2010-04-12 14:41:39)转载标签:杂谈 分类:技术学习 如何把异常信息屏蔽掉,论文发布系统中,当用户不存在时或者密码错误时总是报一大段的异常从throws 改为try{}catch(Exception e){}均如此!!2010-04-12 14:39:07,734 WARN (com.opensymphony.xwork2.util.OgnlUtil:369) - Caught OgnlException while setting property 'account' on type 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
ognl.NoSuchPropertyException: org.apache.struts2.dispatcher.ServletActionRedirectResult.account.......................................................2010-04-12 14:39:07,859 WARN (com.opensymphony.xwork2.util.OgnlUtil:369) - Caught OgnlException while setting property 'errorcode' on type 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
ognl.NoSuchPropertyException: org.apache.struts2.dispatcher.ServletActionRedirectResult.errorcode...................................................未解决,请看到的支下招哦! Thanks
ognl.NoSuchPropertyException: org.apache.struts2.dispatcher.ServletActionRedirectResult.account.......................................................2010-04-12 14:39:07,859 WARN (com.opensymphony.xwork2.util.OgnlUtil:369) - Caught OgnlException while setting property 'errorcode' on type 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
ognl.NoSuchPropertyException: org.apache.struts2.dispatcher.ServletActionRedirectResult.errorcode...................................................未解决,请看到的支下招哦! Thanks
或者throws Exception但是提议的一点是:养成try{}catch(Exception e){e.printStackTrack();}对以后程序的调试很有帮助。像用户名和密码错误的情况你可以自己用代码来判断。如果是错误的,自己处理一下就行了。