From: Jan B. <ja...@mo...> - 2006-11-29 18:01:40
|
Thomas, The defaults descriptor set in WebAppContext.setDefaultsDescriptor(String) is searched for in (order): 1. a resource from the classloader for the webapp 2. a resource for the classloader that loaded the jetty classes 3. a resource from the system classloader 4. as url resource 5. as a relative or absolute File You should be able to use one of those locations to store your customized webdefaults.xml file. cheers Jan Eric Rizzo wrote: > On 11/28/06, Thomas Dudziak <to...@gm...> wrote: >> On 11/28/06, Eric Rizzo <eri...@gm...> wrote: >> >>> You can use the method setDefaultsDescriptor() (via code or XML in >>> your Jetty XML configuration file) to specify your own webdefaults.xml >>> file. >> Yeah, I tried that, but AFAICT it searches in the classpath and >> unfortunately I don't have control over the classpath that Jetty runs >> with. > > It searches relative to the "running" directory, and probably works > with absolute paths, too (although I'm not sure about that). Here is a > section from a jetty.xml that does exactly this: > > <Call name="addWebApplication"> > <Arg>/</Arg> > <Arg>./webapp</Arg> > > <Set name="extractWAR">false</Set> > <Set name="defaultsDescriptor">config/webdefault.xml</Set> > </Call> > > This worked with a directory structure like this: > > MyAppRoot/ > startJetty.cmd > config/ > jetty.xml > webdefault.xml > webapp/ > index.jsp > WEB-INF/ > <etc...> > > The running directory was MyAppRoot/ and it was able to locate the > webdefault.xml as specified in the XML configuration. As I said, I > believe it will work with an absolute path, too, although I try to > avoid any absolute paths in configuration/scripts whenever possible. > > Hope this helps, > Eric > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jetty-support mailing list > Jet...@li... > https://lists.sourceforge.net/lists/listinfo/jetty-support > |