You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Zimmek, Jan" <Ja...@jamba-ag.de> on 2003/12/03 11:01:57 UTC

ActionMapping - dependency - question

Hi,

I have started to develop several reusable struts-enhancements like
(conditional-execution of actions, workflow, ...).
All of them have been realized using the nested <set-property> element of
the <action> element which is working very nice ;)

What I do not understand is, why the ConfigRuleSet.java defines the
following rule:

digester.addSetProperty("struts-config/action-mappings/action/set-property",
"property", "value");

instead of something similar to the datasource/plugin - rule:

digester.addRule("struts-config/plug-in/set-property", new
PlugInSetPropertyRule());

which invokes a method E.g. :

addProperty(String key, String value)

and not a "setter"-method like (when property="test") :

setTest(String value)


Due to this fact I am running into problem because I am not able to use
multiple enhancements at the same time, unless the defined
"ActionMapping"-class of the action implements "setter"-methods for all
required properties.

E.g:

class MyMapping
{
  setPermissionName()
  setNextFlow()
  setXXX
  ...
}

In my opinion this is a dependency which contradicts the independency of the
struts-framework as a whole.

It would be great if one of you could give me a hint on how to solve my
problem without changing the struts.DTD or anything along those lines.

Any help is very appreciated.

Jan Zimmek

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org