in web.xml and creates the springapp context. What I don't understand is how does the container know to build the spring context using the file springapp-servlet.xml? Is this as simple as, the servlet name is springapp so there should be a file called springapp-servlet.xml I can use to build the context to service this request? If so, is this a "Spring framework"thing ?
Q2, when the springapp-servlet.xml context is loaded, it appears the framework then finds the type of class to service the request based on looking at the following mappings in springapp-servlet.xml.
So I modified the urlMapping id to id="MickyMouse" and it still worked so what kind of voodoo is going on where by the framework knows to magically pluck the classname springappController out of the list of mappings in this particular bean definition?
1) Just a naming convention that uses the Servletname-servlet.xml. But you can set an init-param to the DispatcherServlet if your config file is a different name and/or in different locations.
2) The id of the bean SimpleUrlMappingHandler has no meaning at all in mapping. Notice the prop key="xxx" what goes in there is what is mapped. A MappingHandler class is simply a class that the DispatcherServlet delegates looking at the URL to determine which Controller to call. You can actually register more than one MappingHandler, and the Request will be passed to all of them and the first that says they understand the URL and what Controller to call, calls it.
There are many times that you are registering a bean/class that is a Spring class that you want to help set up some api/technology, but not a bean that you as a developer need an id to ref or call getBean on. And the SimpleUrlMappingHandler is one of those. Once Spring sees you have a bean of that class which implements the MappingHandler interface, it will create an instance and put it in its correct place.