Background
I am new to spring and have been looking at how the dispatcher probes @controller annotated classes and methods.
Question
If you can have multiple dispatcher servlets in a single web application how do you assign them to specific controllers?
Assuming Spring 3.x, you would configure each dispatcher with its own Spring configuration file (or class). Then (assuming an XML config) in one dispatcher, you would declare:
<context:component-scan base-package="com.acme.project.foo"/>
and in the other dispatcher you would do:
<context:component-scan base-package="com.acme.project.bar"/>
That way each dispatcher would be associated with different Controllers based on their package structure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With