java - Handle two dispatcher Servlets using AbstractAnnotationConfigDispatcherServletInitializer -
i trying configure spring maven multimodule project. have two dispatcher servlets (say foo {module a}, bar {module b}) in 2 child web modules. trying configure single root context , in module , spring abstractannotationconfigdispatcherservletinitializer configuring
appcontext extends abstractannotationconfigdispatcherservletinitializer{ @override protected class<?>[] getrootconfigclasses() { return new class[] { ... }; } @override protected class<?>[] getservletconfigclasses() { return new class[] { foo.class, bar.class* }; //bar.class desired not getting } @override protected string[] getservletmappings() { return new string[] { "/" }; } } now problem when importing module b inside module a, since both war files , not able access bar.class. module a web application ui , module b rest api.
so, there way configure both inside single application context, or need create application context rest module ?
if need information let me, know.
you can use maven multi module functionality.
add below code in pom.xml of module a
<modules> <module>**artifactid of module b**</module> </modules>
Comments
Post a Comment