1 Sep 2007 01:08
Re: Jetty context parameters
Jan Bartel <janb <at> webtide.com>
2007-08-31 23:08:52 GMT
2007-08-31 23:08:52 GMT
Mika, You've got a couple of options with Jetty (other than the standard web.xml route which Evgeny already mentioned). Option 1: Use a jetty-web.xml file to define the init params. This is a file that you put in your WEB-INF directory which contains configuration for the webapp that Jetty will apply to the webapp AFTER it has applied web.xml. The syntax and general information on jetty-web.xml is here: http://docs.codehaus.org/display/JETTY/jetty-web.xml Here's an example of setting up jetty-web.xml with some context init params: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <Set name="initParams"> <New class="java.util.HashMap"> <Put name="aaa">123</Put> </New> </Set> </Configure> Option 2: Set up your webapp using the ContextDeployer, which uses a context.xml file to define the webapp. It's contents is exactly the same as the jetty-web.xml file, but it doesn't go inside your webapp. The information on that is here: http://docs.codehaus.org/display/JETTY/ContextDeployer Good luck Jan(Continue reading)
RSS Feed