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
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 +
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
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
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.
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,
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
7 matches
Mail list logo