Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Conditional XML feature?


We have been increasingly parametrizing the XML configuration so that most commonly set values can come from properties, so the XML is full of lots of clauses like:

<Set name="someName"><Property name="scope.someName" default="someValue" /></Set>

This works fine except for the issue that the default value has to be hard coded into the XML and the java (for embedded usage).   For the best part of 20 years I've rejected the idea of conditional XML (just write java!), but I'm kind of thinking now that it would be good to avoid the default value by having XML like:

<If name="scope.someName"><Set name="someName"><Property name="scope.someName"/></Set></If>

So the set would be done only if the property was set and thus no default value is needed.  This would also allow multiple statements which could provide conditional configuration which would otherwise need a module (or XML editing) and could even have <Else?> clauses.

Is this a bad idea or something we should consider for 9.4.0?

--

Back to the top