Don
Hubert Rabago wrote:
Updated diffs, if anyone is interested, are in http://www.rabago.net/struts/configinheritance/ . If anybody gets a chance, please take a look, ask questions, make suggestions or comments. If I don't hear from anybody in a couple of days, I will go ahead and commit these changes.
Known limitation:
A "sub" config cannot override a "base" config's property in order to revert to a default value.
In the code that inherits configuration, I check if a property has been set or not. If it hasn't been set, I inherit the value from the base config. The way I check is by comparing the value against the known default:
if (getType() == null) { setType(config.getType()); }
This means that as long as the base config provides a value for a property different from the default, the sub config cannot use the default value for it. For another example, if a forward named "success" is extending another forward named "home", and "home" has redirect="true", "success" cannot be defined such that redirect="false", due to code like this:
if (!getRedirect()) { setRedirect(baseConfig.getRedirect()); }
Of course if you can help overcome this limitation, I would appreciate it.
Hubert
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
