हैलो मैं वसंत बूट का उपयोग करने के लिए अपने पुराने कोड को फिर से लिखने की कोशिश कर रहा हूं। मेरे पास एक श्रोता public class ExecutorListener implements ServletContextListener
है।वसंत बूट में ServletContextListener को कैसे पंजीकृत करें
मैं इस श्रोता को वसंत बूट के लिए कैसे पंजीकृत कर सकता हूं? मैं कोशिश की है:
@SpringBootApplication
@ComponentScan
public class Application extends SpringBootServletInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
servletContext.addListener(new ExecutorListener());
}
}
लेकिन contextInitialized
विधि कहा जाता है नहीं है।