From a high level, Struts2 is a pull-MVC (or MVC2) framework. The Model-View-Controller pattern in Struts2 is realized with following five core components:

  • Actions
  • Interceptors
  • Value Stack / OGNL
  • Results / Result types
  • View technologies

Struts 2 is slightly different from a traditional MVC framework in that the action takes the role of the model rather than the controller, although there is some overlap.

The above diagram depicts the Model, View and Controller to the Struts2 high level architecture. The controller is implemented with a Struts2 dispatch servlet filter as well as interceptors, the model is implemented with actions, and the view as a combination of result types and results. The value stack and OGNL provide common thread, linking and enabling integration between the other components.

Apart from the above components, there will be a lot of information that relates to configuration. Configuration for the web application, as well as configuration for actions, interceptors, results, etc.

This is the architectural overview of the Struts 2 MVC pattern. We will go through each component in more detail in the subsequent chapters.

Request life cycle

Based on the above digram, one can explain the user's request life cycle in Struts 2 as follows:

  • User sends a request to the server for requesting for some resource (i.e pages).
  • The FilterDispatcher looks at the request and then determines the appropriate Action.
  • Configured interceptors functionalities applies such as validation, file upload etc.
  • Selected action is executed to perform the requested operation.
  • Again, configured interceptors are applied to do any post-processing if required.
  • Finally the result is prepared by the view and returns the result to the user.

Struts 2 - Architecture的更多相关文章

  1. Struts 2 - Hello World Example

    As you learnt from the Struts 2 architecture, when you click on a hyperlink or submit an HTML form i ...

  2. Struts 2 Tutorial Basic MVC Architecture

    Model View Controller or MVC as it is popularly called, is a software design pattern for developing ...

  3. Struts和SpringMVC两种MVC框架比较

    基于Web的MVC framework在J2EE的世界内已是空前繁荣.TTS网站上几乎每隔一两个星期就会有新的MVC框架发布.目前比较好的MVC,老牌的有Struts.Webwork.新兴的MVC框架 ...

  4. 重读《Struts In Action》

    Figure   1.1. The Java Servlet API exposes the HTTP client/server protocol to the Java   platform. S ...

  5. spring3+struts2+hibernate3整合出现的问题,No mapping found for dependency [type=java.lang.String, name='struts.objectFactory.spring.enableAopSupport']

    七月 11, 2016 3:49:24 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule ...

  6. Struts2的一个问题: 找不到struts.xml的路径问题

    一. 最近在学习Struts2的一些知识,在使用Struts2搭建框架的时候,部署到服务器上的时候出现上面的问题: 三月 19, 2016 1:43:24 下午 org.apache.tomcat.u ...

  7. struts体系结构

    问题:   为什么 invoke()方法,一旦执行,表示action方法执行完毕,jsp页面已经处理完毕: 其返回值再修改无意义,不影响结果?? 解释: 着重看如下颜色的字: ■ ■ 官方文档有明确的 ...

  8. struts原理图

    n the diagram, an initial request goes to the Servlet container (such as Jetty or Resin) which is pa ...

  9. Struts 2 Overview

    Struts2 is popular and mature web application framework based on the MVC design pattern. Struts2 is ...

随机推荐

  1. VMware 安装Ubuntu16.04时显示不全的解决方法

    实际安装时发现进行到分区这个步骤时,看不到下面的按钮, 百度后得知有此遭遇的不在少数,是因为系统默认分辨率与电脑分辨率的差异导致的. 解决方法也很简单粗暴: 左手按住alt键右手鼠标往上拖动安装界面, ...

  2. my-innodb-heavy-4G.cnf配置文件注解

    [client] ####客户端 port = 3306 ####mysql客户端连接时的默认端口号 socket = /application/mysql-5.5.32/tmp/mysql.sock ...

  3. Python 函数01

    Python 函数 函数是组织好的,可重复使用的,用来实现单一,或相关联功能的代码段. 函数能提高应用的模块性,和代码的重复利用率.你已经知道Python提供了许多内建函数,比如print().但你也 ...

  4. Kubernetes 1.5集成heapster

    Heapster是kubernetes集群监控工具.在1.2的时候,kubernetes的监控需要在node节点上运行cAdvisor作为agent收集本机和容器的资源数据,包括cpu.内存.网络.文 ...

  5. Tomcat权威指南-读书摘要系列1

    1. Tomcat的开幕式 1.1. Tomcat是以Java编写的 1.2. 以catalina命令启动和停止Tomcat .\catalina.bat start // 启动 .\catalina ...

  6. VS2010 中更改项目名称

    Time.vcxproj修改项目名称,主要是通过以下几个步骤就能完成: 修改解决方案的名称. 修改解决项目名称. 修改项目的程序集名称和默认命名空间 替换整个项目或解决方案中的出现该名称的地方. 修改 ...

  7. vue ESLint自动修复

    在package.json文件中的"lint"里面加入--fix 然后终端里输入:npm run lint 1. vue用命令直接修复ESLint

  8. 2015/11/7用Python写游戏,pygame入门(7):碰撞检测

    我们已经完成了飞机大战的大部分东西,但是游戏还是没有办法正式开玩,因为子弹并不能打掉飞机.只有完成了这一个工作,游戏才算基本成型. 今天的内容就非常简单了,就是做到这个碰撞检测,以及控制好子弹和飞机的 ...

  9. Python练习-生成器表达式-筛选与运算

    # 编辑者:闫龙 l = [10, 2, 3, 4, 5, 6, 7] l1 = [int(i)**2 for i in l] # 得到一个新列表l1,新列表中每个元素是l中对应每个元素值的平方 pr ...

  10. 适配器在JavaScript中的体现

    适配器设计模式在JavaScript中非常有用,在处理跨浏览器兼容问题.整合多个第三方SDK的调用,都可以看到它的身影. 其实在日常开发中,很多时候会不经意间写出符合某种设计模式的代码,毕竟设计模式就 ...