Hi all,
I’d like to know what
the best practice on handling exceptions is.
I’m using:
Jsps ---->struts actions ----> session facades ---->
entity beans
Imagine for a second that the
session façade allows CRUD operations on
my entity beans. For example say I have a entity bean called customer.
Now if I try to create a
customer using a session façade method should I
Throw a CreateException
back to the struts action so I can tell the client
I couldn’t create the
customer?
I have read that both FinderExceptions and CreateExceptions
in session
Facades should just log it
and throw new EJBException
[ http://www-106.ibm.com/developerworks/java/library/j-ejbexcept.html
]
but how can you give a meaningful error back to the
client as to what
happened? So should I catch finder and create exceptions in
the struts
actions?
I’m very confused.
Perhaps someone can give me some advice
Thanks,
Brian