Doesn't have to be complicated. Just ensure you don't have a /WEB-INF/ directory, and you can use this on Jetty 9.2.9+
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" " http://www.eclipse.org/jetty/configure_9_0.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Set name="contextPath">/example</Set> <Set name="war">/mnt/iiiparnex01_pdf/PDF/III/</Set> </Configure> -- Joakim Erdfelt <[email protected]> webtide.com <http://www.webtide.com/> - intalio.com/jetty Expert advice, services and support from from the Jetty & CometD experts eclipse.org/jetty - cometd.org On Wed, Mar 11, 2015 at 8:31 AM, <[email protected]> wrote: > > Hi Joakim, > > /mnt/iiiparnex01_pdf/PDF/III/ is a mounted volume which contains PDFs. > > How do I make the /foo context point to it? > > Philippe > > > > > > > ----- Mail transféré ----- > De: "Joakim Erdfelt" <[email protected]> > À: "JETTY user mailing list" <[email protected]> > Envoyé: Mercredi 11 Mars 2015 16:22:26 > Objet: Re: [jetty-users] Instantiating a ResourceHandler in XML > > > > You don't, there's no need to. > > > Just make a directory in ${jetty.base}/webapps/ like > ${jetty.base}/webapps/foo/ > > > and put content into it. > Now your content is being served from a ResourceHandler, at the context > "/foo" > > > Also, a ResourceHandler is rather simple, and doesn't do many more > advanced features that the DefaultServlet provides (like ETags, cache > control, gzip compression, partial requests, ranged requests, > gzip-precompressed logic, etc ...) > > > > > > > > -- > Joakim Erdfelt < [email protected] > > webtide.com - intalio.com/jetty > Expert advice, services and support from from the Jetty & CometD experts > eclipse.org/jetty - cometd.org > > On Wed, Mar 11, 2015 at 7:35 AM, < [email protected] > wrote: > > > Hello, > > how does one instantiate a ResourceHandler using xml files? > > I've tried the following but to no avail. > > <?xml version="1.0"?> > <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" " > http://www.eclipse.org/jetty/configure.dtd "> > <Configure class="org.eclipse.jetty.webapp.WebAppContext"> > <Set name="contextPath"><SystemProperty name="aContext" > default="/acontext" /></Set> > <Set name="handler">acontext-handler.xml</Set> > </Configure> > > > acontext-handler.xml: > > <?xml version="1.0"?> > <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" " > http://www.eclipse.org/jetty/configure.dtd "> > <Configure class="org.eclipse.jetty.server.handler.ResourceHandler"> > <Set name="resourceBase">/mnt/iiiparnex01_pdf/PDF/III/</Set> > </Configure> > > Many thanks. > > Philippe > > _______________________________________________ > jetty-users mailing list > [email protected] > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://dev.eclipse.org/mailman/listinfo/jetty-users > > > _______________________________________________ > jetty-users mailing list > [email protected] > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://dev.eclipse.org/mailman/listinfo/jetty-users > _______________________________________________ > jetty-users mailing list > [email protected] > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://dev.eclipse.org/mailman/listinfo/jetty-users >
_______________________________________________ jetty-users mailing list [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jetty-users
