Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
No announcement yet.
what is the best way to get ApplicationContext from inside of bean in web app?Page Title Module
parameter ServletContext is available from implementing ServletContextAware interface in bean class that use getWebApplicationContext(..)
edit: unfortunately servletContext in case ServletContextAware is equal null in constructor since I can't get Resource in bean constructor.
edit2: unfortunately WebApplicationContext is null after this in bean init-method: WebApplicationContext webappctx = WebApplicationContextUtils.getWebApplicationContex t(servletContext); although servletContext there is not null