Struts 中的控制器 [英] Controller in Struts
本文介绍了Struts 中的控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
MVC 中的控制器是什么?
是 struts.xml
还是 Servlet
(Action Class)?
我们的应用程序中可以有多个 Controller
吗?
拥有多个控制器是一种好习惯吗?
解决方案
在 Struts 中,应用程序控制器层代码/功能分为两部分:
ActionServlet
和RequestHandler
Action
类
ActionServlet
就像
图片来自 这篇 OnJava 文章一>.
What is Controller in MVC ?
Is it struts.xml
or Servlet
(Action Class)?
Can we have more than one Controller
in our application?
Is it good practice to have more than one controller?
解决方案
In Struts, application Controller layer code/functionality is split into two parts:
ActionServlet
withRequestHandler
Action
classes
ActionServlet
acts like FrontController pattern.
Image from this OnJava article.
这篇关于Struts 中的控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文