and webwork technology. Its new Struts 2 architecture differs greatly from the architecture of struts 1. Struts 2, with webwork as its core, uses interceptors to handle user requests, and the design allows the business logic controller to completely disengage from SERVLETAPI, so struts 2 can be understood as WebWork's updated product. Although there are too many changes from struts 1 to struts 2, the chang
1. struts is an open-source software framework released by the apache Foundation. We can see it on the apache official website. Struts2 is a framework improved based on WebWork. It has no major relationship with struts1 2. in the development of struts2, we should better understand struts2 (frontend to backend Processing). struts has
1. struts is an open-source software framework released by the apache Foundation. We can see it on the apache official w
before you learn Struts2, let's look at what is Struts2: Struts2 is a Web application framework based on the MVC design pattern, which essentially corresponds to a servlet, in the MVC design pattern, Struts2 as a controller to establish the data interaction between the model and the view. Struts 2 is the next generation of struts and is the new Struts 2 framework that was combined with struts 1 and webwork technology. Its new Struts 2 architecture dif
operational requirements, and so on, many for some to perform a certain operating conditions of judgment.3. Data Access layer: That is often said DAO layer, specifically for dealing with the database interaction, such as common additions and deletions and other changes. Jdbc/hibernate technology is used in this layer.In the project, these different layers of representation, in fact, in our own built in the different package to write the respective hierarchy of the Java classes used. For example
Accounting for 134 Chen YiWhat does Struts 2 know aboutStruts 2 is the next generation of struts and is the new Struts 2 framework that was combined with struts 1 and webwork technology. Its new Struts 2 architecture differs greatly from the architecture of struts 1. Struts 2, with webwork as its core, uses interceptors to handle user requests, and the design allows the business logic controller to complete
Enterprise Java Beans (EJB), JDBC, and JNDI.
In addition to the standard JavaServer Pages (JSP), the view end of struts 1 also provides a large number of tag libraries, at the same time, it can also be integrated with other presentation layer component technologies (products), such as velocity templates and XSLT.
Through the application of Struts framework, users can finally focus most of the focus on their own business logic (action) and ing relationship configuration file (struts-config.xml
.
In addition to the standard JavaServer Pages (JSP), the view end of struts 1 also provides a large number of tag libraries, it can also be integrated with other presentation layer component technologies (products), such as velocity templates and XSLT.
By applying the Struts framework, end users can focus most of their attention on their own business logic (action) and ing relationship configuration file (struts-config.xml.
3. Basic execution process of struts1
For details, see struts basic
1. Introduction to actioncontext
Actioncontext (COM. opensymphony. xwork. actioncontext is the context of Action execution. The context can be considered as a container (in fact, the container here is just a map ), it stores the objects required for action execution. For example, when webwork is used, our context contains Request Parameters and sessions) servlet context and locale.
Unlike strut1, actions in struts2 do not depend on any Web container,
objects.
Verify
Struts1.x supports manual verification in the validate method of ActionForm, or through Commons Validator extension. The same class may have different verification content, but it cannot verify the child object.
Struts2 supports verification through the validate method and XWork verification framework. The XWork verification framework uses the checksum defined for the attribute class type to support the chain checksum subattribute.
ActionExecution Control
1View usageJSP
L webwork2 uses locale = en_us by default, encoding = ISO-8859-1
L modify webwork. properties to ensureWebwork. locale = zh_cn, Webwork2 will be automatically localized to Chinese
L do not add
And
This will display garbled characters.
L in this way, the Chinese characters can be correctly displayed in the view.
2View usageVelocity
L no need to set
L but there are also problems: Due to the
ASP. the DataGrid in. NET is very convenient and flexible. During this time, I wrote a grid implementation for JSP by referring to the DataGrid Interface UI of for webwork. In my opinion, in terms of usage, the DataGrid implemented by TAG is different from that implemented by ASP. net DataGrid is not inferior in terms of flexibility or scalability.
The following is my grid implementation method.
Compared with the. NET DataGrid, I only define two t
Skip this article for fans of struts and webwork.
Does MVC separate M, V, and C? The simplest approach is that Two JSPs are responsible for the view, one is responsible for the Controller, and the other is responsible for the model Java Bean, which can already work well. At that time, everything was very simple.Now, for some non-essential functions, so many non-standard Web frameworks are depressing. It is as simple as Ruby on Rails for development an
Before describing the use of the S: iterator label, first understand the value stack in struts2. Here we refer to the description of value stack in webwork. Because struts2 is upgraded Based on webwork, the expression of value stack in webwork is also applicable to struts2. Here we do not describe what value stack does, but there are two points to note:
A value
I don't know when our web site has some. XX web pages. Anyone familiar with Java knows to use a new Servlet technology .. VM is a velocity application,. Do Is A struts application, and. Action is a webwork application. The detailed consideration is actually the extension of Servlet technology. By defining your own servlet, You can parse the extensions of different applications. It is indeed not a simple file extension, but a new open source inspiratio
Since struts1.1 was used in the previous project, it has never been used for open-source frameworks.
Struts2 is no different from webwork at the beginning. I want to take a look at webwork. webwork is based on xwork, and xwork exists independently of webiner iner, start with xwork.
Xwork is built in the command mode.
For more information about the command mode, s
1. struts1 and struts2 are two completely different frameworks. In fact, the core of struts2 is the webwork framework. struts1 uses actionservlet as the core controller and the actionservlet is responsible for intercepting all users' requests. The struts 1 framework has three important components: Action, actionform, and actionforward objects. Actionform must implement the base class of actionform, which is not designed as a real pojo. The core contro
In fact, struts2 is not an upgraded version of struts 1, but an upgraded version of webwork. Because struts2 is a webwork upgrade, rather than a new framework, it guarantees stability and performance in all aspects: it also absorbs the advantages of struts 1 and webwork, it is a good framework, which is very simple, clean, and powerful. Next we will use struts2 t
I attended an interview today and asked about the implementation architecture of struts2. Although I have been familiar with it on weekdays, it suddenly touched me ..
Sort out several commonly used stickers and call them on a daily basis
I. Spring-Overview.
A module diagram: the Core of spring is the IOC bean manager. With the support of the AOP module, the upper-layer Dao, Jee, and Web applications are gradually expanded. Spring is a super "template mode", providing a large number of templ
, you can configure multiple copies of the Action instance, which is the same action class in the struts configuration file. Configure multiple action Mappings7. actionconfig, formbeanconfig, and forwardconfig indicate the configuration information of action, formbean, and forward respectively. actionmapping is a subclass of actionconfig.8. response can be directly used in the action to return the response result, but the forward object cannot be returned. Otherwise, the content of the forward o
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.