Design mode with Spring's MVC structure

xiaoxiao2021-03-06  60

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 org.springframework.web.servlet.dispatcherservlet 2 counted *. Htm 2) After receiving the request, send different pages To different controllers: Errorscontroller 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:

In fact, in the usual development, we often use the above design patterns; just Spring is more beautiful, so Spring is very popular.

转载请注明原文地址:https://www.9cbs.com/read-114518.html

New Post(0)