Hi, regarding context handlers, take a look at the documentation. [1] As the Jetty file is interpreted *after *the server is started it needs special attention.
regards, Achim [1] - http://ops4j.github.io/pax/web/SNAPSHOT/User-Guide.html#adding-specialized-contexthandlers 2016-08-17 21:38 GMT+02:00 iJava <[email protected]>: > I have a folder outside war /temp/mydata and I want static servlet read > files from this folder when web context is /static/filestorage. > Besides I have other not default servlets, for example 5 servlets. And I > need them also to work. > > I've found solution in internet: > <Configure class="org.eclipse.jetty.webapp.WebAppContext"> > <Set name="handler"> > <New id="Handlers" class="org.eclipse.jetty.server.handler. > HandlerCollection"> > <Set name="handlers"> > <Array type="org.eclipse.jetty.server.Handler"> > <Item> > <Set name="handler"> > <New class="org.eclipse.jetty. > servlet.ServletContextHandler"> > <Set name="contextPath">/static/ > filestorage</Set> > <Set name="handler"> > <New class="org.eclipse.jetty. > server.handler.ResourceHandler"> > <Set name="resourceBase">/temp/ > mydata</Set> > </New> > </Set> > </New> > </Set> > </Item> > </Array> > </Set> > </New> > </Set> > </Configure> > However, it throws Config error at [Set:null] exception - BTW - what does > it mean????. I have tried different ways to make arrays of handlers but the > same result. > is it possible? > > The following code works, but only static content from /temp/data. Other 5 > servlets don't work. How to solve such problem? > <Configure class="org.eclipse.jetty.webapp.WebAppContext"> > <Set name="handler"> > <New class="org.eclipse.jetty.servlet.ServletContextHandler"> > <Set name="contextPath">/static/filestorage</Set> > <Set name="handler"> > <New class="org.eclipse.jetty.server.handler.ResourceHandler"> > <Set name="resourceBase">/temp/mydata</Set> > </New> > </Set> > </New> > </Set> > </Configure> > > -- > -- > ------------------ > OPS4J - http://www.ops4j.org - [email protected] > > --- > You received this message because you are subscribed to the Google Groups > "OPS4J" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
