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