RE: exception handling in business beans

2002-04-11 Thread Sandeep Takhar

using declarative security in the struts config -- you
can specify which forward to go to when a specific
error occurs within an action.

new to struts 1.1
--- "Maturo, Larry" <[EMAIL PROTECTED]>
wrote:
> We also follow the second approach, and propagate
> all the exceptions from the business beans to the
> action classes.  However, since our business beans 
> don't know about the application they are in, we are
> 
> finding that their error messages are not the worlds
> 
> best.  Has anyone come up with a good solution for 
> this?
> 
> -- Larry Maturo
>[EMAIL PROTECTED]
> 
> 
> -Original Message-
> From: Jerome Josephraj [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 09, 2002 10:07 AM
> To: Struts Users Mailing List
> Subject: RE: exception handling in business beans
> 
> 
> Adolfo,
> 
>   We have similar architecture and we follow the
> second approach.
> We propagate all the exceptions from the business
> bean to action class
> and log it in there (infact in ActionClass facade
> which delegates all
> the requests to appropriate action classes). 
> 
>  By doing this way any changes in
> log4j/additional functionality
> (i.e firing a mail)/any niceties can be added at one
> place
> 
> Cheers,
> 
> Jerome.
> 
> -Original Message-
> From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
> Sent: 09 April 2002 15:35
> To: [EMAIL PROTECTED]
> Subject: exception handling in business beans
> 
> 
> Hi All,
> 
> just a design question, probably beyond Struts
> scope, but interesting 
> anyway. As the documentation says, business beans,
> invoked from Action 
> classes must atomically handle access to resources.
> They should not even
> know that they are running in a web application, so
> they be reusable
> pieces.
> 
> My question is about opinions about handling
> exceptions. We intend use
> Log4J 
> proyect for this task. I figure out two possible
> approaches:
> 
> 1- handling exceptions try{}catch{} in each single
> business bean and
> logging 
> to log files from them, or
> 
> 2- propagate such exceptions to the invoker Action
> which will be
> responsible 
> for logging and doing right treatment. For this
> solution, classes that 
> propagate the exceptions upwards should add their
> identification to the 
> message or whichever info necessary for identiying
> the exception source.
> 
> I bet for second approach, since IMHO it produces
> reusable beans, untied
> to 
> log configuration. I would appreciate opinions for
> this concern.
> 
> Regards,
> 
> Adolfo.
> 
> 
> 
>
_
> Send and receive Hotmail on your mobile device:
> http://mobile.msn.com
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>   _  
> 
> This message contains confidential information and
> is intended only for
> the individual named. If you are not the named
> addressee you should not
> disseminate, distribute or copy this e-mail. Please
> notify the sender
> immediately by e-mail if you have received this
> e-mail by mistake and
> delete this e-mail from your system. E-mail
> transmission cannot be
> guaranteed to be secure or error-free as information
> could be
> intercepted, corrupted, lost, destroyed, arrive late
> or incomplete, or
> contain viruses. The sender therefore does not
> accept liability for any
> errors or omissions in the contents of this message,
> which arise as a
> result of e-mail transmission. If verification is
> required please
> request a hard-copy version. 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




RE x 3: Para adolfo.Re: exception handling in business beans

2002-04-10 Thread Pello Xabier Altadill Izura Pello Xabier Altadill Izura

>The point is that it is NOT a personal issue.  This is a public forum from
>which users derive benefits only from a public discussion of the issues.  If
>you want to respond to someone in a non-English language, do so privately.
>Otherwise you merely waste our bandwidth.
>
>Mark

I know it is NOT a personal issue. I said:
>Sorry, next time I'll try to respond personally.
Sorry again.
Please NOW, would you respond to my question? 

>now:
>>And I'm not sure I agree with you on the propagation of the 
>> ActionErrors
>>from the ActionBean through the failure mapping.
>
>why not?

please try to use our precious bandwidth with
answers. 
I proposed to use ActionErrors instance in BizLogic beans,
or to define a independent error bean that could be converted
in ActionBean.

Singing: Please forgiv m..

_
Pello Xabier Altadill Izura
Ingeniero Informatico y ademas navarro






---
Descubre el poder de la personalización en línea. Todos tus servicios
favoritos en un solo lugar: http://www.terra.com/tumonitor/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Para adolfo.Re: exception handling in business beans

2002-04-10 Thread Galbreath, Mark

The point is that it is NOT a personal issue.  This is a public forum from
which users derive benefits only from a public discussion of the issues.  If
you want to respond to someone in a non-English language, do so privately.
Otherwise you merely waste our bandwidth.

Mark

-Original Message-
From: Pello Xabier Altadill Izura Pello Xabier Altadill Izura
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 7:36 AM
To: Struts Users Mailing List
Subject: RE: Para adolfo.Re: exception handling in business beans



Sorry, next time I'll try to respond personally.
I beg your pardon.
now:
>And I'm not sure I agree with you on the propagation of the 
> ActionErrors
>from the ActionBean through the failure mapping.

why not?
share your options.

Bye..

_
Pello Xabier Altadill Izura
Ingeniero Informatico y ademas navarro






---
Descubre el poder de la personalización en línea. Todos tus servicios
favoritos en un solo lugar: http://www.terra.com/tumonitor/

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


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




RE: Para adolfo.Re: exception handling in business beans

2002-04-10 Thread Pello Xabier Altadill Izura Pello Xabier Altadill Izura


Sorry, next time I'll try to respond personally.
I beg your pardon.
now:
>And I'm not sure I agree with you on the propagation of the 
> ActionErrors
>from the ActionBean through the failure mapping.

why not?
share your options.

Bye..

_
Pello Xabier Altadill Izura
Ingeniero Informatico y ademas navarro






---
Descubre el poder de la personalización en línea. Todos tus servicios
favoritos en un solo lugar: http://www.terra.com/tumonitor/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Para adolfo.Re: exception handling in business beans

2002-04-10 Thread Galbreath, Mark

That was really helpful.  There are other-language user-groups, you know.
And I'm not sure I agree with you on the propagation of the ActionErrors
from the ActionBean through the failure mapping.

Mark

-Original Message-
From: Pello Xabier Altadill Izura Pello Xabier Altadill Izura
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 4:10 AM
To: Struts Users Mailing List
Subject: Para adolfo.Re: exception handling in business beans


Hola adolfo
Supongo que entenderas el castellano:
Para lo que planteas, ya estas dando soluciones tu mismo; yo te daria otra
opcion:
Desde el action bean instancia el bean de logica de negocio, ejecuta
la operacion pertinente y haz que el bean devuelva una instancia
de ActionErrors:
si la instancia es nula, todo es OK y rediriges a success
en caso contrario guardas la instancia de ActionErrors devuelta por el bean
de logica de negocio y redirigues a una pagina de error donde se mostrara el
mensaje correspondiente.
Para que esta propagracion del error desde la logica de negocio hasta la jsp
funcione, dentro del bean de logica de negocio deberas guardar los errores
en el ActionErrors que devuelves.
Solo tiene un problema: el bean de logica de negocio ya no sera totalmente
independiente de struts ya que utiliza dos instancias: ActionErorrs y
ActionError; quiza para conseguir una independencia total, que es lo que
buscas, tendras que definir otro objeto que guarde errores y convertirlo a
ActionError en el ActionBean que invoca la logica de negocio.
Espero haberte sido de ayuda.

Hasta luego!

pd: si te interesa, he creado un tutorial de struts que esta disponible en
http://ciberia.ya.com/pxai/ma.html , el cual pretendo ir mejorando.

_
Pello Xabier Altadill Izura
Ingeniero Informatico y ademas navarro






---
Descubre el poder de la personalización en línea. Todos tus servicios
favoritos en un solo lugar: http://www.terra.com/tumonitor/

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


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




Gracias Pello.Re: exception handling in business beans

2002-04-10 Thread Adolfo Miguelez

Hola Pello,

Muchas gracias por tu respuesta. En principio mis ideas van por esto que tu
comentas, incluso habiamos pensado aqui en crear un bean de errores propio,
para independizar de Struts. Yo estoy por Mapfre en Madrid.

Como curiosidad, lo del tutorial funciona, pues ya me lo habia imprimido, me
habia puesto un bookmark, e incluso habia estado ojeando tu CV que en cierta
manera se parece al mio. Te confieso que aun no no lo he leido en detalle,
aunque lo tengo en la "coleccion de recursos".

http://www.geocities.com/ResearchTriangle/Facility/1021/CV.htm aunque esta
desactualizado, y bastante chapucero. Me queria pillar un dominio y hacer
algo decente con Struts, tutoriales y tal, y habia elegido ya
http://www.webappcabaret.com/index.html.

:-)

Bueno fuera coñas. Esto de Struts a mi me gusta un monton, y no me
extrañaria se convierta en un standard en poco tiempo. Te has dado cuenta
que no existen libros? ... uno y malo, y menos en castellano.

El problema basicamente es desde donde hacer el log al fichero de log4J, con
el objetivo de hacer los beans modulares y que no sepan que corren en Web y
menos en Struts. Propagando la excepcion, o una propia MapfreException, hay
que añadirle algo a la excepcion para que vaya traceando desde la clase
donde se genera, por aquellas por las que pasa.

El objetivo es que sea el action el que haga el log, y ademas conozca donde
se genero la excepcion.

Voy a echarle una pensada hoy mas en detalle.

Saludetes y gracias,

Adolfo.





From: "Pello Xabier Altadill Izura  Pello Xabier Altadill Izura"
<[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "Struts Users Mailing List"  <[EMAIL PROTECTED]>
Subject: Para adolfo.Re: exception handling in business beans
Date: Wed, 10 Apr 2002 01:09:40 -0700

Hola adolfo
Supongo que entenderas el castellano:
Para lo que planteas, ya estas dando soluciones tu mismo; yo te daria otra
opcion:
Desde el action bean instancia el bean de logica de negocio, ejecuta
la operacion pertinente y haz que el bean devuelva una instancia
de ActionErrors:
si la instancia es nula, todo es OK y rediriges a success
en caso contrario guardas la instancia de ActionErrors devuelta por el bean
de logica de negocio y redirigues a una pagina de error donde se mostrara
el mensaje correspondiente.
Para que esta propagracion del error desde la logica de negocio hasta la
jsp funcione, dentro del bean de logica de negocio deberas guardar los
errores en el ActionErrors que devuelves.
Solo tiene un problema: el bean de logica de negocio ya no sera totalmente
independiente de struts ya que utiliza dos instancias: ActionErorrs y
ActionError; quiza para conseguir una independencia total, que es lo que
buscas, tendras que definir otro objeto que guarde errores y convertirlo a
ActionError en el ActionBean que invoca la logica de negocio.
Espero haberte sido de ayuda.

Hasta luego!

pd: si te interesa, he creado un tutorial de struts que esta disponible en
http://ciberia.ya.com/pxai/ma.html , el cual pretendo ir mejorando.

_
Pello Xabier Altadill Izura
Ingeniero Informatico y ademas navarro









_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Para adolfo.Re: exception handling in business beans

2002-04-10 Thread Pello Xabier Altadill Izura Pello Xabier Altadill Izura

Hola adolfo
Supongo que entenderas el castellano:
Para lo que planteas, ya estas dando soluciones tu mismo; yo te daria otra opcion:
Desde el action bean instancia el bean de logica de negocio, ejecuta
la operacion pertinente y haz que el bean devuelva una instancia
de ActionErrors:
si la instancia es nula, todo es OK y rediriges a success
en caso contrario guardas la instancia de ActionErrors devuelta por el bean de logica 
de negocio y redirigues a una pagina de error donde se mostrara el mensaje 
correspondiente.
Para que esta propagracion del error desde la logica de negocio hasta la jsp funcione, 
dentro del bean de logica de negocio deberas guardar los errores en el ActionErrors 
que devuelves.
Solo tiene un problema: el bean de logica de negocio ya no sera totalmente 
independiente de struts ya que utiliza dos instancias: ActionErorrs y ActionError; 
quiza para conseguir una independencia total, que es lo que buscas, tendras que 
definir otro objeto que guarde errores y convertirlo a ActionError en el ActionBean 
que invoca la logica de negocio.
Espero haberte sido de ayuda.

Hasta luego!

pd: si te interesa, he creado un tutorial de struts que esta disponible en 
http://ciberia.ya.com/pxai/ma.html , el cual pretendo ir mejorando.

_
Pello Xabier Altadill Izura
Ingeniero Informatico y ademas navarro






---
Descubre el poder de la personalización en línea. Todos tus servicios
favoritos en un solo lugar: http://www.terra.com/tumonitor/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: exception handling in business beans

2002-04-09 Thread Maturo, Larry

We also follow the second approach, and propagate
all the exceptions from the business beans to the
action classes.  However, since our business beans 
don't know about the application they are in, we are 
finding that their error messages are not the worlds 
best.  Has anyone come up with a good solution for 
this?

-- Larry Maturo
   [EMAIL PROTECTED]


-Original Message-
From: Jerome Josephraj [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 10:07 AM
To: Struts Users Mailing List
Subject: RE: exception handling in business beans


Adolfo,

We have similar architecture and we follow the second approach.
We propagate all the exceptions from the business bean to action class
and log it in there (infact in ActionClass facade which delegates all
the requests to appropriate action classes). 

 By doing this way any changes in log4j/additional functionality
(i.e firing a mail)/any niceties can be added at one place

Cheers,

Jerome.

-Original Message-
From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
Sent: 09 April 2002 15:35
To: [EMAIL PROTECTED]
Subject: exception handling in business beans


Hi All,

just a design question, probably beyond Struts scope, but interesting 
anyway. As the documentation says, business beans, invoked from Action 
classes must atomically handle access to resources. They should not even
know that they are running in a web application, so they be reusable
pieces.

My question is about opinions about handling exceptions. We intend use
Log4J 
proyect for this task. I figure out two possible approaches:

1- handling exceptions try{}catch{} in each single business bean and
logging 
to log files from them, or

2- propagate such exceptions to the invoker Action which will be
responsible 
for logging and doing right treatment. For this solution, classes that 
propagate the exceptions upwards should add their identification to the 
message or whichever info necessary for identiying the exception source.

I bet for second approach, since IMHO it produces reusable beans, untied
to 
log configuration. I would appreciate opinions for this concern.

Regards,

Adolfo.



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
  _  

This message contains confidential information and is intended only for
the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
contain viruses. The sender therefore does not accept liability for any
errors or omissions in the contents of this message, which arise as a
result of e-mail transmission. If verification is required please
request a hard-copy version. 

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


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




RE: exception handling in business beans

2002-04-09 Thread Jerome Josephraj

Adolfo,

We have similar architecture and we follow the second approach.
We propagate all the exceptions from the business bean to action class
and log it in there (infact in ActionClass facade which delegates all
the requests to appropriate action classes). 

 By doing this way any changes in log4j/additional functionality
(i.e firing a mail)/any niceties can be added at one place

Cheers,

Jerome.

-Original Message-
From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
Sent: 09 April 2002 15:35
To: [EMAIL PROTECTED]
Subject: exception handling in business beans


Hi All,

just a design question, probably beyond Struts scope, but interesting 
anyway. As the documentation says, business beans, invoked from Action 
classes must atomically handle access to resources. They should not even
know that they are running in a web application, so they be reusable
pieces.

My question is about opinions about handling exceptions. We intend use
Log4J 
proyect for this task. I figure out two possible approaches:

1- handling exceptions try{}catch{} in each single business bean and
logging 
to log files from them, or

2- propagate such exceptions to the invoker Action which will be
responsible 
for logging and doing right treatment. For this solution, classes that 
propagate the exceptions upwards should add their identification to the 
message or whichever info necessary for identiying the exception source.

I bet for second approach, since IMHO it produces reusable beans, untied
to 
log configuration. I would appreciate opinions for this concern.

Regards,

Adolfo.



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
  _  

This message contains confidential information and is intended only for
the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be
intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
contain viruses. The sender therefore does not accept liability for any
errors or omissions in the contents of this message, which arise as a
result of e-mail transmission. If verification is required please
request a hard-copy version. 

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




exception handling in business beans

2002-04-09 Thread Adolfo Miguelez

Hi All,

just a design question, probably beyond Struts scope, but interesting 
anyway. As the documentation says, business beans, invoked from Action 
classes must atomically handle access to resources. They should not even 
know that they are running in a web application, so they be reusable pieces.

My question is about opinions about handling exceptions. We intend use Log4J 
proyect for this task. I figure out two possible approaches:

1- handling exceptions try{}catch{} in each single business bean and logging 
to log files from them, or

2- propagate such exceptions to the invoker Action which will be responsible 
for logging and doing right treatment. For this solution, classes that 
propagate the exceptions upwards should add their identification to the 
message or whichever info necessary for identiying the exception source.

I bet for second approach, since IMHO it produces reusable beans, untied to 
log configuration. I would appreciate opinions for this concern.

Regards,

Adolfo.



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: