This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
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