As the title says what is the difference between dispatcher-servlet.xml and spring-servlet.xml They seem very similar in terms of structure. When should one be used over the other ?
As the title says what is the difference between dispatcher-servlet.xml and spring-servlet.xml They seem
Share
Here’s an explanation from spring forums
Basically it’s just the name. Dispather is autoloading context called [servletname]-servlet.xml so in this case there’s a servlet called ‘spring’ and another called ‘dispatcher’.
You name your servlets in
web.xml.For example if you had:
in your
web.xmlthen DispatcherServlet would try to loadbabubiba-servlet.xmlby default.If you can change context name by adding
contextConfigLocationinit-param to your servlet config.