Why does Jetty's cross-origin filter cause the server to crash? -
as instructed in http://www.eclipse.org/jetty/documentation/current/cross-origin-filter.html, enable cross-origin requests on jetty-8.1.18.v20150929 (bundled basex 8.5), downloaded jetty-servlets-8.1.18.v20150929.jar
, , placed in web-inf/lib.
also, in web.xml, added:
<filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.crossoriginfilter</filter-class> <init-param> <param-name>allowedorigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedmethods</param-name> <param-value>get,post,options</param-value> </init-param> <init-param> <param-name>allowedheaders</param-name> <param-value>*</param-value> </init-param> </filter> <filter-mapping> <filter-name>cross-origin</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
however, causes jetty crash @ startup. missing?
that class doesn't exist in jetty 8. halts startup because have referenced class cannot found/loaded/instantiated.
write own crossoriginfilter need do.
make sure supports:
- servlet 3.0 based
- async supported flag
- asynccontext aware
note: not copy/paste version jetty 9 (the 1 attempted use), supports features present in servlet 3.1 , not work in jetty 8.
Comments
Post a Comment