`
toowzh
  • 浏览: 870 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

Struts中的Action是Model还是Controller

阅读更多

看看官方的介绍,我理解Action和ActionServlet一样也是Controller,

 附“Struts in a Nutshell”, 摘自: http://struts.apache.org/1.3.8/index.html

The framework provides its own web Controller component and integrates with other technologies to provide the Model and the View. For the Model, the framework can interact with standard data access technologies, like JDBC and EJB, as well as most any third-party packages, like Hibernate, iBATIS, or Object Relational Bridge. For the View, the framework works well with JavaServer Pages, including JSTL and JSF, as well as Velocity Templates, XSLT, and other presentation systems.

The framework's Controller acts as a bridge between the application's Model and the web View. When a request is received, the Controller invokes an Action class. The Action class consults with the Model (or, preferably, a Facade representing your Model) to examine or update the application's state. The framework provides an ActionForm class to help transfer data between Model and View.

Most often, the Model is represented as a set of JavaBeans. Typically, developers will use the Commons BeanUtils to transfer data between ActionForms and the Model objects (or a Facade). Preferably, the Model will do the "heavy lifting", and the Action will act as a "traffic cop" or adapter.

分享到:
评论

相关推荐

    Struts in Action 中英文对照

    它的出现为开发者提供了一种结构化的解决方案,使得构建MVC(Model-View-Controller)模式的应用程序变得更加简单和高效。"Struts in Action"是一本深入介绍Struts框架的经典著作,由Craig R. McClanahan和David ...

    struts in action 英文版

    Struts是基于Model-View-Controller(MVC)设计模式的Java框架,它在J2EE(Java 2 Platform, Enterprise Edition)环境中扮演着重要的角色,帮助开发者组织和管理复杂的Web项目。 Struts框架的核心功能包括动作调度...

    Struts 框架之构建 Model组件.rar

    Struts框架是Java Web开发中广泛使用的一种MVC(Model-View-Controller)框架,它为开发者提供了一种结构化的方式来组织和管理应用程序。在这个压缩包文件“Struts 框架之构建 Model组件.rar”中,我们主要关注的是...

    Struts In Action(英文)

    Struts是一个开源的Java Web应用程序框架,它基于Model-View-Controller(MVC)设计模式,旨在简化开发过程,提高代码的可维护性和可扩展性。这本书详细介绍了如何使用Struts构建高效、健壮的企业级Web应用。 书中...

    Struts in Action

    首先,书中的"源码"部分可能会探讨Struts框架的内部工作原理,包括Action、Form Bean、Controller Servlet、Tiles和国际化等关键组件的源代码分析。通过阅读源码,读者可以理解Struts如何处理HTTP请求,以及如何将...

    moke测试struts的action

    Struts主要用于构建基于MVC(Model-View-Controller)设计模式的Web应用程序,以提高开发效率和代码的可维护性。在标题“moke测试struts的action”中,我们关注的焦点是Struts框架中的Action组件。 Action是Struts...

    Struts的小列子三个Action

    5. **MVC模式**:在Struts框架中,Action作为Controller,处理请求并决定接下来的流程。Model通常是业务对象,而View则由JSP页面构成,显示处理结果。这种分离使得代码更易于测试和维护。 6. **例子分析**:虽然...

    Struts In Action

    1. **MVC模式**:Struts遵循Model-View-Controller设计模式,将业务逻辑、视图展示和控制流程分离,使得代码结构清晰,易于维护。 2. **请求调度**:Controller组件(ActionServlet)负责接收HTTP请求,并根据配置...

    struts in action 源码

    Struts是Apache软件基金会的一个开源项目,它为构建基于Model-View-Controller(MVC)架构的Web应用程序提供了一个强大的框架。 **Struts框架核心概念** 1. **Model**: 在Struts中,Model通常代表业务逻辑,负责...

    Struts in Action 中文修正版

    Struts是一个基于Model-View-Controller(MVC)设计模式的开源框架,它极大地简化了Java Web应用程序的开发。 在Struts框架中,Action类是核心组件,它处理HTTP请求并驱动业务逻辑。Action类通过ActionForm接收来自...

    Struts2 in action

    Struts2最大的特点之一是其与MVC(Model-View-Controller)设计模式的紧密结合。 - **Model(模型)**:负责存储数据和业务逻辑。 - **View(视图)**:用户界面,显示数据。 - **Controller(控制器)**:接收用户...

    Struts In Action书籍

    Struts是一个开源的MVC(Model-View-Controller)框架,它为构建基于Java EE的Web应用程序提供了一种结构化和可扩展的方法。在本书中,作者详细介绍了如何有效地利用Struts来设计和实现高效的Web应用。 本书分为多...

    struts in action 中文

    这本书深入浅出地讲解了如何使用Struts来构建动态、交互式的Web应用程序,帮助开发者理解MVC(Model-View-Controller)设计模式在实际开发中的应用。 Struts是一个开源的Java框架,最初由Apache软件基金会开发并...

    Struts in action中文版

    Struts是MVC(Model-View-Controller)设计模式在Web应用中的典型实现,它极大地简化了企业级Java应用的开发工作。 Struts框架的核心概念包括以下几个方面: 1. **Controller**:控制器是Struts的核心组件,主要由...

    Struts2 in action 中文版

    Struts2是一个开源的Web应用程序框架,它遵循Model-View-Controller(MVC)设计模式,主要用于构建企业级的Java Web应用。Struts2框架简化了Web应用的开发过程,通过将业务逻辑、数据管理和用户界面分离,提高了代码...

    Struts In Action中文章节版

    Struts是一个开源的MVC(Model-View-Controller)框架,它旨在简化Java Web开发,提供一种结构化的、组件化的开发方式,以提高开发效率和代码质量。 在《Struts In Action》一书中,你可以学习到以下几个关键知识点...

    Struts2实战(Struts2 In Action中文版)

    Struts2作为一款强大的MVC(Model-View-Controller)框架,极大地简化了Java Web应用的开发流程,提高了开发效率。本书的中文版为国内开发者提供了全面了解和掌握Struts2技术的宝贵资源。 在Web应用开发中,Struts2...

Global site tag (gtag.js) - Google Analytics