As module B has dependency for module A and module A has it's own application context file called applicationContext.xml , then make sure applicationContext.xml is getting bundled with module A jar to place it in classpath.
Now you need to add ContextLoaderListener in Module B web.xml,
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:/<package folder structure in jar>/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Also you need to add following lines in both xmls , applicationContext.xml and mvc-dispatcher-servlet.xml
<context:component-scan base-package="<packages for stereotype>" />
With this, bean should get injected.