I can access Spring beans in my Servlets using
WebApplicationContext springContext =
WebApplicationContextUtils.getWebApplicationContext(getServle
For filters - use Filter.init()
:
public void init(FilterConfig config) {
WebApplicationContext springContext =
WebApplicationContextUtils.getWebApplicationContext(config.getServletContext());
}
For tags - use TagSupport.pageContext
(note that it's not available in SimpleTagSupport
):
WebApplicationContext springContext =
WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());