diff --git a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java index 4d485b7bbfb..abf396ddfa6 100644 --- a/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java +++ b/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/AsyncContextState.java @@ -64,10 +64,9 @@ public class AsyncContextState implements AsyncContext @Override public T createListener(Class clazz) throws ServletException { - // TODO: Use ServletContextHandler createInstance use DecoratedObjectFactory. try { - return clazz.getDeclaredConstructor().newInstance(); + return state().getContextHandler().getContext().getServletContext().createInstance(clazz); } catch (Exception e) {