This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See But can i really run more than one servlets on loading a particular jsp?
I did something in web.xml like
shashank dwivedi wrote: But can i really run more than one servlets on loading a particular jsp?
Well, no, that isn't a good idea either. As you yourself say, each controller should have its own purpose. If the controller (the one servlet) needs to execute code which is in some other servlets, then perhaps the code in the other servlets should be in a class whose methods can be called from many servlets. Or perhaps your controller servlet ought to be forwarding to the other servlet. It's hard to say without knowing your requirements. However it is possible to say that the idea of having lumps of code isolated in servlets and then needing to execute more than one of those lumps needs revising.