Currently my jsp 2.0 tags that need spring beans use this code:
ac = WebApplicationContextUtils.getWebApplicationContext( servletContext);
ac.getBeansOfType(MyRequestedClass.class);
The I just get the first matching bean.
This code works fine, but has the undesired drawback that I spend about half my page rendering time looking up spring beans, since this happens every time a tag is invoked. I was thinking maybe to put the bean into application scope or at least session scope. But what's really the smartest way of handling this problem ?