mirror of https://github.com/apache/activemq.git
Fixing support for Jetty 9.3 and Jetty 9.2. The previous attempt at a fix had the wrong class instance.
This commit is contained in:
parent
1a2e3eb0c7
commit
29b4db5c34
|
@ -30,6 +30,7 @@ import org.eclipse.jetty.security.ConstraintSecurityHandler;
|
||||||
import org.eclipse.jetty.server.Connector;
|
import org.eclipse.jetty.server.Connector;
|
||||||
import org.eclipse.jetty.server.Handler;
|
import org.eclipse.jetty.server.Handler;
|
||||||
import org.eclipse.jetty.server.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
|
import org.eclipse.jetty.server.handler.HandlerWrapper;
|
||||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||||
import org.eclipse.jetty.servlet.ServletHolder;
|
import org.eclipse.jetty.servlet.ServletHolder;
|
||||||
|
|
||||||
|
@ -124,13 +125,13 @@ public class HttpTransportServer extends WebTransportServerSupport {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addGzipHandler(ServletContextHandler contextHandler) throws Exception {
|
private void addGzipHandler(ServletContextHandler contextHandler) throws Exception {
|
||||||
Handler handler = null;
|
HandlerWrapper handler = null;
|
||||||
try {
|
try {
|
||||||
handler = (Handler) forName("org.eclipse.jetty.server.handler.GzipHandler").newInstance();
|
handler = (HandlerWrapper) forName("org.eclipse.jetty.servlets.gzip.GzipHandler").newInstance();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
handler = (Handler) forName("org.eclipse.jetty.servlets.gzip.GzipHandler").newInstance();
|
handler = (HandlerWrapper) forName("org.eclipse.jetty.server.handler.gzip.GzipHandler").newInstance();
|
||||||
}
|
}
|
||||||
contextHandler.setHandler(handler);
|
contextHandler.insertHandler(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Class<?> forName(String name) throws ClassNotFoundException {
|
private Class<?> forName(String name) throws ClassNotFoundException {
|
||||||
|
|
Loading…
Reference in New Issue