This may have been lost in the (US) holiday shuffle, or because it was tucked into a subject line which might not have indicated a suggestion for a change to a relatively core part of Struts. So I just thought I'd air it one more time before I make any changes to ActionConfig.

Note that the idea of this is simply to minimize the need to write custom subclasses of ActionMapping. The existing "configured" (frozen) semantics would continue to apply to this new property.

Joe


At 3:44 PM -0600 11/23/04, Joe Germuska wrote:
A month ago, Craig added two action classes to struts-chain. Looking at them now, I see that they only work with the "default" or un-named catalog. Is this a serious issue? Is anyone actually using them yet? I'm just catching up with the named-catalog changes in commons-chain, but it seems likely that this will be a limitation. Unfortunately, ActionMapping only gives us one parameter slot to pass something in, and that's used up with either the name of the command or the name of the request parameter which has the command.

Now that I write this, this may be a good opportunity to propose adding a simple mapped property to ActionConfig that would allow more flexible per-mapping configuration. This came up on the list before (can't remember if I brought it up or not) and I'm pretty sure at least one other committer said he thought it was a good idea. This is a pet enhancement request from one of the developers on my team, but I think it's a good idea too. I just don't know if I like any naming options, mostly just with the possible confusion between bean properties and java.util.Properties.

<action-mapping path="/foo" type="org.apache.struts.chain.legacy.ChainAction">
    <set-property name="props(command-name)" value="my-command" />
    <set-property name="props(catalog-name)" value="my-catalog" />
    ...
</action>

public class ActionConfig {
...
private java.util.Properties props = new java.util.Properties();
public void setProps(String key, String value) { this.props.setProperty(key,value); }
public String getProps(String key) { return this.props.getProperty(key); }


...
}

Any takers? Strong opinions about the name of the mapped property? Preference for some alternative XML specification with corresponding extensions to the struts-config DTD?

Joe

From: <craigmcc <at> apache.org>
Subject: svn commit: rev 55393 - struts/trunk/contrib/struts-chain/src/java/org/apache/struts/chain/legacy
Newsgroups: gmane.comp.jakarta.struts.devel
Date: Sat, 23 Oct 2004 18:30:37 +0000


Author: craigmcc
Date: Sat Oct 23 11:30:37 2004
New Revision: 55393

Added:

struts/trunk/contrib/struts-chain/src/java/org/apache/struts/chain/legacy/ChainAction.java

struts/trunk/contrib/struts-chain/src/java/org/apache/struts/chain/legacy/DispatchAction.java
Log:
Add a couple of ways that an Action can delegate its business logic
processing to a Chain (or Command):

* ChainAction - Name of the chain is configured in the <action> element

* DispatchAction - Name of the chain is specified by a request parameter
  (analogous to the standard org.apache.struts.actions.DispatchAction)
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex


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


--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex

Reply via email to