What I left out yesterday from my original posting is that the
test I was working on had 2 servlets in it, each with their own DispatcherServlet configuration. I was doing this to not have to specify a URL
pattern in the web.xml file so that each servlet could handle a different mapping based on RequestMapping settings.
By trying to autowire a bean in servlet 1 and not in servlet 2, I was getting an error about not being able to autowire the bean in servlet 2 - even though I hadn't put it into servlet 2. I included it for component scanning in servlet 1's context file for the bean to be autowired.
In my web.xml file I used the same url-pattern, '/', for both servlets. As soon as I changed the pattern for the 2nd servlet to anything other than / or /* it worked fine. The RequestMapping in servlet 2 took care of the mapping I wanted.
If I put the bean to be autowired in the root context file I could put the url-pattern back to '/' for both servlets.
So can someone explain what was happening? Is there a bug here or is this behavior 'normal'? The fact that I could change the url-pattern for both servlets to '/' when the bean to be autowired is included in the roo† context still seems strange.
Thanks.
Les