Alex, I would suggest that you don't use a WebAppContext, as that is setup to have web.xml, WEB-INF stuff and JSP. So you have lots of machinery that you are not using.
Instead I would just use a ContextHandler with a ResourceHandler. You can see some background on this at https://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty#Configuring_a_File_Server although that does not have a ContextHandler, but reading down that page shows you how to add a ContextHandler (although replace the HelloHandler with the ResourceHandler). You will then have a simple lightweight setup with no JSP mechanism, not even a ServletHandler! cheers On 28 June 2016 at 21:11, Alexander Farber <[email protected]> wrote: > Hello, > > to serve a static (only HTML files and images) virtual host I have created > the following /var/www/jetty-base/webapps/afarber.de.xml file: > > <?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"> > <New id="root" class="java.lang.String"> > <Arg>/var/www/html/afarber.de</Arg> > </New> > > <Set name="contextPath">/</Set> > <Set name="virtualHosts"> > <Array type="java.lang.String"> > <Item>afarber.de</Item> > <Item>www.afarber.de</Item> > </Array> > </Set> > <Set name="resourceBase"><Ref refid="root" /></Set> > <Set name="welcomeFiles"> > <Array type="string"> > <Item>index.html</Item> > <Item>index.php</Item> > </Array> > </Set> > </Configure> > > And it works well, but prints a warning at the start-up: > > INFO::main: Logging initialized @196ms > INFO:oejs.Server:main: jetty-9.3.10.v20160621 > INFO:oejdp.ScanningAppProvider:main: Deployment monitor > [file:///var/www/jetty-base/webapps/] at interval 1 > INFO:oejsh.ContextHandler:main: Started > o.e.j.s.ServletContextHandler@2b98378d{/,file:///var/www/html/ > slova.de/,AVAILABLE,slova.de} > INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /, did not > find org.eclipse.jetty.jsp.JettyJspServlet > INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@57536d79 > {/,file:///var/www/html/afarber.de/,AVAILABLE,afarber.de} > INFO:oejs.AbstractConnector:main: Started > ServerConnector@fcd6521{proxy,[proxy, > http/1.1]}{0.0.0.0:8080} > INFO:oejs.Server:main: Started @495ms > > I am not planning to use JSP, is there please a way to silence this > warning? > > Do I have to specify a different handler for WebAppContext and how to do > it in XML? > > Thank you > Alex > > > _______________________________________________ > 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 > -- Greg Wilkins <[email protected]> CTO http://webtide.com
_______________________________________________ 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
