Fix injection of AsyncListener

This commit is contained in:
Jan Bartel 2022-07-05 09:32:22 +10:00
parent 4e7fa4b943
commit a4b9f19e26
1 changed files with 1 additions and 2 deletions

View File

@ -64,10 +64,9 @@ public class AsyncContextState implements AsyncContext
@Override @Override
public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException
{ {
// TODO: Use ServletContextHandler createInstance use DecoratedObjectFactory.
try try
{ {
return clazz.getDeclaredConstructor().newInstance(); return state().getContextHandler().getContext().getServletContext().createInstance(clazz);
} }
catch (Exception e) catch (Exception e)
{ {