java - Implementing servlet lifecycle methods in a Spring web application? -


i implementing web application using spring. using spring's contextloaderlistener, load application contexts, , spring's dispatcherservlet, load relevant beans {name}-servlet.xml, refer beans in main application context. want able integration test these spring configurations outside of container validate wired correctly before deploy tomcat. application requires scheduled background processing when running in container. in regular httpservlet implement init() , destroy(). suggestions have read suggest using initializingbean kind of initialization.

however, if use initializingbean, afterpropertiesset() gets called whether inside container or in integration tests - , outside container, don't have access resources background task needs. there better way perform tasks perform in init() , destroy() run when deployed webapp?

have considered using test spring config file overrides bean implementing background process?

this way else in spring configuration work except 1 overridden bean.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -