-Original Message-
From: V. Cekvenich [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 5:58 PM
To: [EMAIL PROTECTED]
Subject: Re: Right way to extends Action
What about DispatchAction and LookupDispatchAction? Anyone
have a good
solution for reuse of common action logic
Hi,
In our application we use a similar concept :
- we have a class like this :
public abstract class BaseAction extends Action
In this class :
- we added some usefull field like a logger an a pointer to a singleton that
retains application's data
protected Log log =
{
handleErrors(request, errors);
}
return result;
}
-Original Message-
From: Xavier Saint-Denis [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:21 PM
To: Struts Users Mailing List
Subject: Re: Right way to extends Action
Hi,
In our
:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:21 PM
To: Struts Users Mailing List
Subject: Re: Right way to extends Action
Hi,
In our application we use a similar concept :
- we have a class like this :
public abstract class BaseAction extends Action
In this class :
- we added some usefull
: Re: Right way to extends Action
Hi,
In our application we use a similar concept :
- we have a class like this :
public abstract class BaseAction extends Action
In this class :
- we added some usefull field like a logger an a pointer to a singleton
that
retains application's data
- Original Message -
From: Dario Geier [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:41 PM
Subject: RE: Right way to extends Action
I would change the signature of the executeAction method not to throw
Exception, but a custom
Ho Xavier,
so, how do you know which exception are thrown? You'll discover them at runtime :(
-Original Message-
From: Xavier Saint-Denis [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 5:40 PM
To: Struts Users Mailing List
Subject: Re: Right way to extends Action
Hi,
Why have
PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:41 PM
Subject: RE: Right way to extends Action
Ho Xavier,
so, how do you know which exception are thrown? You'll discover them at
runtime :(
-Original Message-
From: Xavier Saint-Denis [mailto:[EMAIL
:22 PM
To: Struts Users Mailing List
Subject: Re: Right way to extends Action
Hum...
To my modest opinion, this is how Struts is designed.
The execute method of the Action class raise Exception.
For exemple when I implement an action that can raise an
IdentificationException, I have to register
file so as to redirect the response
accordingly.
Regards,
Xavier
- Original Message -
From: Dario Geier [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 5:32 PM
Subject: RE: Right way to extends Action
Yes, I know that, but still
Subject: Re: Right way to extends Action
For example, in my BaseAction class, when we verify that the user is logged
in :
if this is not the case, = throw new IdentificationException();
In the Struts config file (or locally to the action) we add :
global-exceptions
exception
type
-Original Message-
From: Xavier Saint-Denis [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:21 AM
To: Struts Users Mailing List
Subject: Re: Right way to extends Action
Hi,
In our application we use a similar concept :
- we have a class like this :
public abstract
: Xavier Saint-Denis [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:21 AM
To: Struts Users Mailing List
Subject: Re: Right way to extends Action
Hi,
In our application we use a similar concept :
- we have a class like this :
public abstract class BaseAction extends Action
What about
- we added some usefull field like a logger an a pointer to a singleton that
retains application's data
protected Log log = LogFactory.getLog(this.getClass());
protected static final Infos infos = Infos.getInstance();
Be aware that adding other properties to Action is not thread safe.
.V
What about DispatchAction and LookupDispatchAction? Anyone have a good
solution for reuse of common action logic across these multiple action base
classes provided by Struts?
I wrote my own dispatch:
thanks buddy, got the idea now. My problem is solved.
-navjot
The programming world now seems to be all about writing wrapper codes ;-)
- Original Message -
From: V. Cekvenich [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 7:27 AM
Subject: Re: Right way to extends
16 matches
Mail list logo