Re: Simple way to configure an action?

2005-01-24 Thread Fredrik Jonson
On 2005-01-24, Larry Meadors [EMAIL PROTECTED] wrote: Maybe we are approaching this from the wrong direction. what is the problem you are trying to solve? Perhaps I am. I have an action which retrieves a couple of values from a database. If the retreival fails, it return some reasonable

Re: Simple way to configure an action?

2005-01-24 Thread Larry Meadors
OK, I think i understand what you are trying to do. You could override the constructor of your action to read in a properties file. If you have multiple actions, you could make it a base class that uses some common naming convention, that may simplify things. On Mon, 24 Jan 2005 08:02:04 +

Re: Simple way to 'configure' an action?

2005-01-24 Thread fzlists
Another possible approach is to create a DefaultValues class, something along these lines: public class DefaultValues { private HashMap defaultValues; { setDefaultValues(); } public static HashMap getDefaultValues() { return defaultValues; } private static void

Re: Simple way to configure an action?

2005-01-24 Thread Jim Barrows
On Mon, 24 Jan 2005 06:13:23 -0700, Larry Meadors [EMAIL PROTECTED] wrote: OK, I think i understand what you are trying to do. You could override the constructor of your action to read in a properties file. If you have multiple actions, you could make it a base class that uses some common

Re: Simple way to configure an action?

2005-01-24 Thread Joe Germuska
Eddie Bush's solution is the right one. The ActionMapping is specifically intended for the purpose you have in mind, and is available every time an Action's execute method is called. Even if the Action will not be called from different action mappings, it will always have one action mapping.

Re: Simple way to configure an action?

2005-01-23 Thread Eddie Bush
Actions are, effectively, singletons. There is a single instance created, no matter how many mappings use it. This means actions have to be thread-safe, and suggests that the best place to configure things would be in the mapping itself, or some other way (resource bundle, propeties file,

Re: Simple way to configure an action?

2005-01-23 Thread Larry Meadors
Maybe we are approaching this from the wrong direction...what is the problem you are trying to solve? On Sun, 23 Jan 2005 17:09:45 -0600, Eddie Bush [EMAIL PROTECTED] wrote: Actions are, effectively, singletons. There is a single instance created, no matter how many mappings use it. This