I have one legacy web application based on struts2 (primarily using annotation). While debugging i find that all the dependencies (like service layer and dao layer)
are injected automatically in struts 2 action. I was expecting there must be some spring interceptor defined in struts.xml which must be doing this.
But i did not find any spring related interceptor over there. Also in web.xml i did not find any related stuff which must be doing this kind of work.
I am not sure how dependencies (with spring) are injected in struts2 action…
I can see struts2-convention-plugin-2.2.3.1.jar file in class path. Does it mean filterDispatcher looks for this jar at run time and if it finds it, inject the dependencies in action. Does any Interceptor also help during this process?
Please refer to
struts-plugin.xmlofstruts2-spring-plugin-x.x.x.x.jar, you can find the config about object factory and autowiring interceptor . It uses the plugin feature of struts2, and you may search ‘plugin’ from Struts Guide for details.