`

struts2 framework's architecture

 
阅读更多



 

In the diagram, an initial request goes to the Servlet container (such as Jetty or Resin) which is passed through a standard filter chain. The chain includes the (optional) ActionContextCleanUp filter, which is useful when integrating technologies such as SiteMesh Plugin. Next, the required FilterDispatcher is called, which in turn consults the ActionMapper to determine if the request should invoke an action.

If the ActionMapper determines that an Action should be invoked, the FilterDispatcher delegates control to the ActionProxy. The ActionProxy consults the framework Configuration Files manager (initialized from the struts.xml file). Next, the ActionProxy creates an ActionInvocation, which is responsible for the command pattern implementation. This includes invoking any Interceptors (the before clause) in advance of invoking the Action itself.

Once the Action returns, the ActionInvocation is responsible for looking up the proper result associated with the Action result code mapped in struts.xml. The result is then executed, which often (but not always, as is the case for Action Chaining) involves a template written in JSP or FreeMarker to be rendered. While rendering, the templates can use the Struts Tags provided by the framework. Some of those components will work with the ActionMapper to render proper URLs for additional requests.

[img]https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" border="0" alt="" width="16" height="16" align="absMiddle[/img]
All objects in this architecture (Actions, Results, Interceptors, and so forth) are created by an ObjectFactory. This ObjectFactory is pluggable. We can provide our own ObjectFactory for any reason that requires knowing when objects in the framework are created. A popular ObjectFactory implementation uses Spring as provided by the Spring Plugin.




Interceptors are executed again (in reverse order, calling the after clause). Finally, the response returns through the filters configured in the web.xml. If the ActionContextCleanUp filter is present, the FilterDispatcher will not clean up the ThreadLocal ActionContext. If the ActionContextCleanUp filter is not present, the FilterDispatcher will cleanup all ThreadLocals.

 

  • 大小: 64.7 KB
分享到:
评论

相关推荐

    struts2.in.action

    than a revision of the Struts 1 framework. If you hadn't yet heard anything about Struts 2, you might expect, based upon the name, to find a new release of that proven framework. But this is not ...

    Struts2教程,很适用哦

    本文主要从概念上讲解什么是struts framework,它的框架结构,组件结构,以及配置讲解。对于其应用请参考后面的“struts安装及应用”和“struts实用案例分析”。 文章的包括了如下四大部分: 一、 Framework的概念...

    struts api 帮助文档

    4. **Tiles Framework**: Struts2集成了Tiles框架,用于创建和管理复杂布局。Tiles定义了页面布局模板,使得多个组件可以组合成一个完整的页面。 5. **Validation Framework**: Struts提供了强大的验证框架,允许...

    strust2.jar

    5. **Plug-in Architecture**:Struts2的插件架构使得开发者可以轻松地扩展框架功能,如添加新的拦截器、结果类型等。 除了`struts2.jar`,描述中还提到了其他几个相关的jar包: 1. **spring.jar**:Spring框架是...

    spring_FrameWork3.0

    - **JCA CCI:** Spring 支持 JCA(Java Connector Architecture)和 CCI(Common Client Interface),用于连接外部系统。 - **EMAIL:** Spring 提供了邮件发送支持。 - **Task Execution and Scheduling:** ...

    Architecture Application Framework-开源

    "Architecture Application Framework"(简称AAF)就是一个这样的框架,专为JavaEE Web应用程序开发设计,旨在帮助开发者快速构建高效、可维护的系统。 AAF基于Struts框架,这是一个非常流行的MVC(模型-视图-控制...

    Spring.MVC.Beginner's.Guide.2nd.Edition.2016.7.pdf

    The Spring MVC Framework is architected and designed in such a way that every piece of logic and functionality is highly configurable. Also, Spring can integrate effortlessly with other popular web ...

    外文翻译 stus MVC

    This definition implies that Struts is a framework, rather than a library, but Struts also contains an extensive tag library and utility classes that work independently of the framework. Figure 5 ...

    雪雅服饰的设计实现分析论文.doc

    The system's architecture, leveraging JSP, Struts, Spring, Hibernate, and MySQL, demonstrates the potential of IT in enhancing efficiency, accessibility, and customer satisfaction within the clothing...

    基于SSM+mysql的企业人事管理系统源码数据库论文.doc

    Based on the analysis and design in previous phases, this system adopts the B/S (Browser/Server) architecture in its design. The frontend development mainly employs JSP (JavaServer Pages) as the ...

    网络编程新手入门

    Java Web Application Development Workshop Chapter 1 Web Development FastTrack 1. 前言和体系结构 ... Struts Framework 3. Spring Framework 4. Hibernate ................................

    Liferay architecture 5

    包括AJAX、Apache ServiceMix、ehcache、Groovy、Hibernate、ICEfaces、Java J2EE/JEE、jBPM、JGroups、jQuery JavaScript Framework、Lucene、MuleSource ESB、PHP、Ruby、Seam、Spring&AOP、Struts&Tiles、...

    毕业论文weixin074儿童预防接种预约微信小程序+springboot论文.doc

    The choice of the Spring-Struts-MyBatis (SSM) framework for the backend development is strategic, as it offers robustness, scalability, and efficient data handling. SSM is a popular Java-based ...

    基于ssm+mysql的大创项目申报管理系统源码数据库论文.docx

    Spring provides dependency injection and manages the lifecycle of components, while Struts handles the request-response flow and defines the MVC (Model-View-Controller) architecture. MyBatis, on the ...

    基于java的医院挂号系统的设计与实现.docx

    1. SSH Framework: This combination of Struts for MVC (Model-View-Controller) architecture, Hibernate for object-relational mapping, and Spring for dependency injection and other enterprise-level ...

    J2EE_API

    Struts 1是早期版本,而Struts 2是其升级版,整合了许多其他框架,如WebWork和Tiles。 "vc"通常指的是Visual C++,Microsoft的C++开发环境,虽然与Java EE本身没有直接关系,但在Windows平台上,开发者可能使用...

    基于ssm+mysql的超市管理系统源码数据库论文.doc

    The main focus of this thesis is on the development of a supermarket management system using JSP technology with a B/S (Browser/Server) architecture. By analyzing the current needs within supermarkets...

    JAVA技术体系.pdf

    - **核心编程**:涉及IO(输入/输出)、多线程(Multithreading)、实体类(Entity Classes)、集合类(Collections Framework)、正则表达式(Regular Expressions)、XML处理以及属性文件(Property Files)。...

Global site tag (gtag.js) - Google Analytics