Thanks for the quick response.
-----Original Message-----
From: James A. N. Stauffer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 8:37 AM
To: JDJList
Subject: [jdjlist] Re: Comparing Exceptions
instanceof
if (errorMessage.getException() instanceof InvalidCredentialsException)
--- "Cohan, Sean" <[EMAIL PROTECTED]> wrote:
> I catch an exception and place it in an object returned to me Struts
> action
> class. How can I see what this eception is in order to display the
> correct
> message to the user?
>
> The object containing the Exception is ErrorMessage which contains a
> getException method which returns an Exception object. Do I use the
> equals
> method to compare the returned exception to it's Exception class like so:
>
>
> (ErrorMessage) errorMessage = (ErrorMessage)
> serviceResponse.getErrorMessage();
>
> if (errorMessage.getException().equals(InvalidCredentialsException)) {
> // do something to display message.
> }
>
> Thanks.
>
>
> To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
=====
James Amos Nathaniel Stauffer
Stauffer_James
@yahoo.com
Spam food: [EMAIL PROTECTED]
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm