At 8:48 AM -0800 11/29/04, Don Brown wrote:
How would this work with digester? As I understand it, digester is the one that actually populates the action config, and then only at init time.
I sure like the idea, but don't know about the naming style. What about foo.bar where foo corresponds to setFoo(Map m) and foo.bar calls m.put("bar")

The example I provided (repeated below) is written according to Digester's built-in support for "mapped properties".


To support the naming style you suggest would require making BeanUtils understand that syntax. I would want to get some other opinions about the implications of that before proposing it, although I don't have a great love for the way it is now.

The more we go down this road of more robust configuration/initialization, the more I think we are going to realize Spring already does this and does it better.

I suspect you're right, as I have come to prefer Spring's BeanFactory to Digester for this kind of thing. Have you ever looked at configuring Struts completely using Spring? It might be an interesting exercise, along with possibly coming up with an XSLT process to make current Struts config files usable with Spring!


Joe

<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); }


...
}

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

Reply via email to