1. Basic Knowledge
Struts2 was developed based on the webwrok technology and adopts the interceptor mechanism to process user requests. Webwork is a powerful web-based MVC framework built on the command mode framework of xwork. All in all, both struts2 and webwork are at the bottom layer of xwork. If you have read the struts source code, you will surely find that many xwork2 types are imported into struts. Here is an introduction to xwork:
For details about webwork, refer to Baidu Encyclopedia:
Http://baike.baidu.com/view/25660.htm
1.1 Xwork1.1.1 Xwork Overview
XWork is implemented in a standard Command mode and is completely isolated from the web layer. Xwork provides many core functions: interceptor, form attribute verification during runtime, type conversion, and powerful expression language (OGNL-the Object Graph NavigationLanguage ), ioC (Inversion of Control Inversion Control) containers.
The purpose is to create a generalized, reusable, and scalable command mode framework, rather than a framework used in a specific field. [1]
1.1.2 features
1. Flexible And customizable configuration based on a simple interface;
2. The core command mode framework can be customized and extended to adapt to any request/response environment;
3. The entire framework is constructed through type conversion and OGNL action attribute verification;
4. It contains a powerful verification framework based on runtime Attribute and verification interceptor.
1.1.3 relationship with webwork
WebWork2 is built on XWork and is based on XWork. The XWork command mode framework and interceptor framework provide a command mode framework that supports Web functions and can quickly build Web applications.
When processing a request, the interaction between Webwork and Xwork is as follows:
Figure 1.1.3 interaction between webwork and xwork