Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Understanding Property tag use

Simone wrote:
> If you want to modify an existing Jetty XML file, you need to copy it
> from $JETTY_HOME/etc to $JETTY_BASE/etc and then modify the
> $JETTY_BASE/etc XML file.
> Of course, for that XML file to be considered, the correspondent
> module should be enabled.
> If you are writing a custom module, then your custom XML file needs to
> be in $JETTY_BASE/etc.
> If you have done the above and does not work, then seems
> like a bug. If that's the case, please open an issue at

I don't think my previous message was clear, but I would expect the Property tag to work for any (enabled) Jetty Configure XML file.

In this instance I'm trying to use it within $JETTY_BASE/webapps, like so:


	<?xml version="1.0"?>
	<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "";>
	<Configure class="org.eclipse.jetty.webapp.WebAppContext">
		<Set name="resourceBase"><Property name="test.prop" />/path</Set>

	<?xml version="1.0"?>
	<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "";>
	<Configure class="org.eclipse.jetty.webapp.WebAppContext">
		<Set name="resourceBase"><SystemProperty name="test.sysprop" />/path</Set>

$ java -jar ../jetty-distribution-9.4.16.v20190411/start.jar

The relevant output shows only the system property works:
> 2019-04-14 16:14:22.786:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@52a86356{/,file:///S:/jetty/property-testing/testsysprop/path,AVAILABLE}
> 2019-04-14 16:14:22.817:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@59906517{/,file:///S:/jetty/property-testing/null/path,AVAILABLE}

I guess that's either a bug or something which should be documented, so I'll go create an issue.

Back to the top