I have a web application which relies on context or init parameters, which I run in Jetty.
I have found out how I can set these in the WEB-INF/web.xml file:
<context-param>
<param-name>myParamName</param-name>
<param-value>42</param-value>
</context-param>
Once I pack my web application into a .war file, I can no longer change these, so I have to somehow set the parameters in the servlet context xml file.
What I found out from the eclipse.jetty Wiki is this:
<Set name="initParameter">
<Arg>myParamName</Arg>
<Arg>42</Arg>
</Set>
But Jetty throws a java.lang.NoSuchMethodException when I try this.
What is the correct way of setting context parameters in Jetty?
You can try to do it such way: