I have web project with Spring and Spring security. My web.xml:
You still need a context for your servlet:
Upon initialization of a DispatcherServlet, Spring MVC looks for a file named [servlet-name]-servlet.xml in the WEB-INF directory of your web application and creates the beans defined there, overriding the definitions of any beans defined with the same name in the global scope.
You don't need to load it as context-param
in the ContextLoaderListener
though.
Just leave the security-config.xml
as context-param
(it has to go there, as security is global per application), and billboard-servlet.xml
as contextConfigLocation
of your servlet and it should work.