All of the pages in my application will have a navigation bar. Instead of trying to have some superclass for all of my ViewControllers that contains methods that can be called on the navbar, I thought I would try something less invasive. I wanted to use Spring AOP introductions to stick the navbar methods into each ViewController at runtime.
I seem to have come across some problems in attempting this though. Issues: * I need to define the view controller in the faces-config file because it needs some sessionscope variables injected into him at runtime, because the view controller is in request scope. I do not know how to reference things from session scope in the spring configuration file. Also if I define my view controller in spring for some reason faces cannot find it. * I thought, ok I will define my advisor in faces config and also my ProxyFactoryBean in faces as well. Unfortunately this doesn't work either. The spring applicationContext object turns list entries into object arrays whereas the faces config turns list entries into ArrayLists. Things blow up when trying to set the interceptorNames field in the ProxyFactoryBean with an ArrayList instead of a String[]. * I cheated in the debugger to get around the list/array issue, but when Spring resolves something that it knows is a factory it calls the getObject method so that it actually returns your aspect decorated target. Faces is not smart enough to do that, so basically it is returning the factorybean object instead of my viewController+nav that I was hoping to get. I hope I am missing something. I guess what I need is a way for the two config files to be interchangeable, meaning that the spring file can have access to the faces beans and also to beans located in the various scopes (session, request, etc.) Is this possible? Am I making things too complicated? JB
