Rivka-

Since you're developing from scratch, you might want to put a layer
in-between your EJBs and Struts. Some will call it business logic,
data access object (DAO), or Helper classes. This allows you to
separate the struts-related concerns from business-related concerns.
It also solves the issue you mentioned about where to catch
RemoteExceptions. Also, these helper classes can be used in more than
one action which could be a benefit.

A quick and dirty fix to your problem would be to declare the
execute() method in your action to also throw a RemoteException, and
then declaratively handle the exception in your Struts config inside
<global-exceptions>. I'd only use this if there's no way for you to
recover the transaction when a remoteException occurs. It's an old
article, but take a look at
http://www.onjava.com/pub/a/onjava/2002/10/30/jakarta.html. These
sites are good for starting out in struts too:
http://husted.com/struts/ and http://www.reumann.net/struts/main.do

Good luck,
-ed

On 7/20/05, Rivka Shisman <[EMAIL PROTECTED]> wrote:
> 
> Erik, Glen, Laurie - Thanks for your help
> 
> After doing some more homework about exception handling - I have another
> question:
> 
> If my Sturts Action calls directly to EJB methods (with no delegate
> Layer) - then I have to catch RemoteException for all runtime
> exceptions? Or is there a better way to work?
> 
> Thanks
> Rivka
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to