This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

As I said in the beginning, I am quite new to Spring, but I am not new to programming and also I don't think I am that far from getting it working. So you don't need to go on forever, really.

I am not asking lightly, I have read enough and I try to understand things instead of just hitting ctrl+c, ctrl+v... What I am doing, as you said, is a complex thing and that's why I am asking here. If it was easy I'd probably manage myself.

I have advanced quite a lot, I have succesfully configured a test project and now @Controllers get scanned and they respond to the URL specified in @RequestMapping("/whatever").

However there are still a few things I don't get. As Enrico said, I probably should investigate a bit more about "the concept of separation between core Spring config loaded with listener and Spring web mvc config loaded with DispatcherServlet context-param", which may be preventing my target project from serve both the original Web Services and the mapped-to-@Controller URL's.

Comment

It is quite simple actually. When using Spring in a web application, you will have one CORE context containing everything non servlet-related (everything that is not web related: services, daos, pojos, aspects etc). This context is loaded by adding the following in web.xml:

You will need one more context since you are also using Spring's web services.

What about relations between those context? Well the core context will be at the disposal of every other servlet-loaded context. This means, for example, that you can inject and use core beans like services and daos inside your controllers.
On the other hand, the reverse is not true: you can't inject beans from your web mvc context inside your core context, but why should you do something like that really? It's controllers that call services and not vice-versa!
Also, your servlet context won't interact with each other, so, for example, you can't inject a controller inside a web service or vice-versa (again, why would you ever need to do something like that?)

Comment

Of course you can configure mvc in your web services context, that is perfectly fine. Just be aware that configuration you do in your dispatcherservlet context won't be available in the other one (they are two different contexts after all) so you must put scanning directives in both config files for example. What won't work is just direct injection between beans of different servlet contexts, because they are independent from one another, but that don't mean you can't configure them both as you like (althought the motivation behind usage of web mvc specific annotations in web services seems to slip my grasp, maybe I need to read something about Spring web services to get a clearer idea).