I am working on Spring MVC portlets and I have all this working. Now I am trying to Autowire a behavior based on a spring-portlet.xml. It seems at runtime I am getting conflicts because of the Behavior that is autowired, too many beans.

So I have a controller that is defined to pick up the portlet VIEW state, I want to wire up the RenderStrategy in the Controller based on portlet context. So portlet A and B can have a different renderRequest functionality. I know I could just have multiple controllers in different packages and this would probably solve this. But this feels more like copy/paste inheritance.

How can I use the child contect.xml to drive this wiring or is there a cleaner way to wire this up? Is there a way to specify this RenderStrategy at runtime for the controller

Any other thought or suggestions would be helpful.

@Controller
@RequestMapping("VIEW")
public class ListController {

@Autowired
private RenderStrategy renderStrategy;