[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] context parameter
|
Hi,
On Tue, Aug 9, 2016 at 5:43 PM, Andrea Franceschini <atariw@xxxxxxxxx> wrote:
> Dear Jetty team,
>
> I am trying to add a context parameter to Jetty, using a jetty-web.xml file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE Configure PUBLIC
> "-//Mort Bay Consulting//DTD Configure//EN"
> "http://www.eclipse.org/jetty/configure_9_0.dtd">
>
> <Configure class="org.eclipse.jetty.webapp.WebAppContext">
> <Set name="initParams">
> <Map>
> <Entry>
> <Item>propertiesDir</Item>
> <Item>C:/Users/myname/workspaceProva/propertiesDir</Item>
> </Entry>
> </Map>
> </Set>
> </Configure>
>
>
> I am getting this exception:
>
>
> ____ ___ __ __ __ ___
> / __/___/ (_)__ ___ ___ __ / /__ / /_/ /___ __ / _ \
> / _// __/ / / _ \(_-</ -_) / // / -_) __/ __/ // / \_, /
> /___/\__/_/_/ .__/___/\__/ \___/\__/\__/\__/\_, / /___/
> /_/ /___/
> 2016-08-09 15:11:57.595:INFO::main: Logging initialized @2166ms
> Configuration:
> C:\Users\AD7E7~1.FRA\AppData\Local\Temp\eclipseJettyPlugin.config.ReplyGAjetty.xml
>
> C:\Users\a.franceschini\workspaceProva\Servers\jetty\jetty-web.xml
> 2016-08-09 15:11:57.821:WARN:oejx.XmlConfiguration:main: Config error
> at <Set name="initParams">|?
> <Map><Entry><Item>propertiesDir</Item><Item>C:/Users/myname/workspaceProva/propertiesDir</Item></Entry></Map>|?</Set>
> java.lang.NoSuchMethodException: class
> org.eclipse.jetty.webapp.WebAppContext.setInitParams(class
> java.util.HashMap) in null
There is no such method.
You should *get* the initParams map, and then just call put() on it.
Jetty's XML can replicate invoking any Java code.
--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.