Java – Glassfish + Spring


I have a quick question, that is, how do I run applications which use Spring framework on Glassfish server? That is, how do I make it run under control of Spring containers? Do I need to extend the server or something, I can't find much information about that, stuff I read about OSGI modules, just confused me.

Best Solution

Basically you use web.xml to fire up Spring with a listener and then you map one or more spring Dispatcher servlets. You define controller beans in the dispatcher-servlet.xml, inject beans you defined in the applicationContext, and it sort of cascades down from there.

        etc etc