Hello Paul, There's no direct support for this use case in Blossom. Magnolia itself is not built on Spring and injection of spring-managed beans is therefor not available in beans outside your application context. As of 4.5 Magnolia uses Guice for IoC. They play nice together in the same webapp. In 4.5 we do support injecting Guice managed beans into the RenderingModel.
So, to solve your use case you'd need to do autowiring on the RenderingModel after it has been created and before its put to use. Therefor constructor injection of your spring-managed bean won't work. If you were to inherit from JspRenderer / FreemarkerRenderer and overload the method newModel(Class, Node,RenderableDefinition,parentModel) you could ask the Spring application context to autowire the rendering model return by the base class. You would then need to configure Magnolia to use your custom renderer. Autowiring an existing bean you can do like this: WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); wac.getAutowireCapableBeanFactory().autowireBean(bean); The custom renderer would be something like this: http://pastie.org/4421213 Note though that I haven't tested it. Hope that helps! // Tobias -- Context is everything: http://forum.magnolia-cms.com/forum/thread.html?threadId=5f4656e6-a1b8-47cd-870a-d4a564f3514f ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
