Struts 2 - Architecture
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的更多相关文章
- 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 ...
- Struts 2 Tutorial Basic MVC Architecture
Model View Controller or MVC as it is popularly called, is a software design pattern for developing ...
- Struts和SpringMVC两种MVC框架比较
基于Web的MVC framework在J2EE的世界内已是空前繁荣.TTS网站上几乎每隔一两个星期就会有新的MVC框架发布.目前比较好的MVC,老牌的有Struts.Webwork.新兴的MVC框架 ...
- 重读《Struts In Action》
Figure 1.1. The Java Servlet API exposes the HTTP client/server protocol to the Java platform. S ...
- 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 ...
- Struts2的一个问题: 找不到struts.xml的路径问题
一. 最近在学习Struts2的一些知识,在使用Struts2搭建框架的时候,部署到服务器上的时候出现上面的问题: 三月 19, 2016 1:43:24 下午 org.apache.tomcat.u ...
- struts体系结构
问题: 为什么 invoke()方法,一旦执行,表示action方法执行完毕,jsp页面已经处理完毕: 其返回值再修改无意义,不影响结果?? 解释: 着重看如下颜色的字: ■ ■ 官方文档有明确的 ...
- struts原理图
n the diagram, an initial request goes to the Servlet container (such as Jetty or Resin) which is pa ...
- Struts 2 Overview
Struts2 is popular and mature web application framework based on the MVC design pattern. Struts2 is ...
随机推荐
- CoreDNS配置kubernetes作为后端
概述 coredns之所以如此名声大噪,就是因为从kubernetes1.9开始引入,作为kubernetes内部服务发现的默认dns.毫无疑问kubernetes是coredns的后端之一,所以我们 ...
- mysql 设置默认编码为 utf8
vi /etc/mysql/mysql.conf.d/mysqld.cnf [client] default-character-set=utf8 [mysql] default-character- ...
- 无法将网络更改为桥接状态 没有VMent0
本文主要分享 VMware 10.0.2 报错信息:无法将网络更改为桥接状态的解决经验 工具/原料 VMware 10.0.2 方法/步骤 1 故障现象,导致虚拟机无法正常上网 设备管理器 ...
- Java并发编程原理与实战四:线程如何中断
如果你使用过杀毒软件,可能会发现全盘杀毒太耗时间了,这时你如果点击取消杀毒按钮,那么此时你正在中断一个运行的线程. java为我们提供了一种调用interrupt()方法来请求终止线程的方法,下面我们 ...
- Windows系统环境下Solr之Java实战(一)搭建solr服务器并配置IK分词
搭建solr服务器 1.下载地址:http://archive.apache.org/dist/lucene/solr/ 2.将D:\JavaWeb\Solr\solr-6.2.0\server\so ...
- js封装Cookie操作
var CookieUtil = { // 设置cookie set : function (name, value, expires, domain, path, secure) { var coo ...
- BZOJ4819 新生舞会
4819: [Sdoi2017]新生舞会 Time Limit: 10 Sec Memory Limit: 128 MB Description 学校组织了一次新生舞会,Cathy作为经验丰富的老学 ...
- shell脚本-监控及邮件提醒
首先写一个邮件提醒python文件 #!/usr/bin/python # -*- coding: UTF-8 -*- import sys import smtplib import email.m ...
- php 创建验证码方法
php创建验证码方法: <?php function getVerify($length=4,$sessName='verify'){ //验证码 //获取字符串 去除01ol等较难辨认字符 $ ...
- python面向对象——类
from:http://www.runoob.com/python3/python3-class.html Python3 面向对象 Python从设计之初就已经是一门面向对象的语言,正因为如此,在P ...