如果查看
Java EE FrontController序列图,Controller会将请求委托给Dispatcher,文档说:
A dispatcher is responsible for view management and navigation,
managing the choice of the next view to present to the user,and
providing the mechanism for vectoring control to this resource.
在Spring MVC中,DispatcherServlet充当FrontController(如Craig Walls一书中所述),此Servlet将请求委托给其他控制器,后者又调用适当的Service类(用于处理请求),然后将ModelAndView的实例返回给DispatcherServlet再次.
所以大致这是请求通常的旅行方式:
客户 – > DispatcherServlet – >控制器 – >服务 – > DAO
如果将此流与Java EE FrontController模式序列图进行比较,则看起来DispatcherServlet不是真正的FrontController.
你怎么说这个?