1) Distributor mode Spring has a unified set of dispatcher org.springframework.web.servlet.dispatcherServlet, generally send all page requests to the dispatcher in Web.xml: Countries servlet-name> org.springframework.web.servlet.dispatcherservlet servlet-class> 2 loading-on-startup> servlet> counted server-name> *. Htm url-pattern> servlet-mapping> 2) After receiving the request, send different pages To different controllers: Errorscontroller prop> props> property> bean> Spring has two mapping mechanisms, default as beannameurlhandlermapping, us here Using SimpleurlHandlermapping.3) Interceptor Mode We can intercept it, do some special or universal processing before the controller process; the interceptor can choose Spring or we implement: list> property> bean>
In fact, in the usual development, we often use the above design patterns; just Spring is more beautiful, so Spring is very popular.