Struts requestprocessor、Action 类和 Form Bean 类在 MVC 中适合什么位置?
这个问题是关于struts 1.2的。众所周知,struts 遵循 mvc 架构。如果我们在struts中定义mvc类,那么jsp就是视图,控制器就是actionservlet,模型就是数据存储,以及操作数据存储中数据的类,如dao类、业务逻辑类和值对象。 对吗?
我的问题是我们可以在 mvc 中的哪里放置 requestprocessor 类、action 类(如 baseaction、dispatc 操作和 Form Bean 类)。我的意思是它们被视为控制器或模型的一部分?
其次是哪个类充当struts中的requestdisptcher。
This question is regarding struts 1.2. As we know struts follows the mvc archtecture. If we define the mvc classes in struts then jsp is view,controller is actionservlet and model is datastore and classes manipulating the data in datastore like dao class, Businees logic class and value objects. Right?
My question is where we can fit requestprocessor class ,action class like baseaction,dispatc action and Form Bean class in mvc. I mean they are considered as part of controller or model?
Second is Which class act as requestdisptcher in struts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Struts 1.2 文档对此进行了介绍:
http://struts.apache。 org/1.2.9/userGuide/introduction.html#mvc
http://struts.apache.org/1.2.9/userGuide/building_model.html
该模型不仅仅是数据存储,它还包括
ActionForm
,以及两者之间的映射。ActionServlet
与RequestProcessor
和ActionMapping
一起实现控制器:ActionServlet
> 将操作查找委托给RequestProcessor
,因此不能说它本身就是控制器。请注意,各个组件之间的定义/差异可能并不总是精确地映射到各个组件。 Struts 1 在 MVC 的原始思想(转化为 Web 应用程序)与当时可用的技术之间提供了某种近似的映射。
This is covered in the Struts 1.2 documentation:
http://struts.apache.org/1.2.9/userGuide/introduction.html#mvc
http://struts.apache.org/1.2.9/userGuide/building_model.html
The model isn't just the datastore, it includes the
ActionForm
, and the mapping between the two.The
ActionServlet
works with theRequestProcessor
andActionMapping
s to implement the controller: theActionServlet
delegates action lookup to theRequestProcessor
so cannot be said to be the controller in itself.Note that the definitions/differences between the various components may not always map precisely to individual components. Struts 1 provides a somewhat-close mapping between the original ideas of MVC, translated into web applications, and the technologies available at the time.