In struts 1.0, we can only. specify a configuration file for actionservlet in XML, which is of course no problem for our online teaching examples. However, it may be troublesome in the actual application development process. Because many developers may need to modify the configuration file at the same time, but the configuration file can only be modified by one person at the same time, this will certainly cause resource competition to a certain extent
Sruts 2 workflow:
All actions in struts 1 have only one instance, which is used repeatedly. Through the red font section of the workflow of struts 2 above, we can clearly see that each action in struts 2 has multiple instances, meaning that an action instance is generated every time a request is processed, these instances are independent of each other and will
Struts internationalization, struts
Internationalization
1. Internationalization and Localization
Internationalization: I18N: when the program is not modified, it can be used in different countries or regions and different language environments, display characters according to the local language and format habits.Localization: L10N: when developing an international program, the process of creating language-
Introduction
Our daily life is well organized, and our daily life is quite regular. For example, when we get up, we have formed a "biological clock ".
In the factory, the workers work hard on the assembly line, and each link constitutes the entire workflow. to do one thing well, a complete workflow is required, beginning and end.
Struts has designed a standard workflow for the web layer of our project for us to follow. That is, if yo
and install maven (http://maven.apache.org/);2. Create an environment variable maven_home indicate your MAVEN installation directory and add $maven_home/bin to your PATH variable;3, manipulate this directory you can expand the source code, execute "Maven.jar" create Target/struts-menu.jar.
To expand the Struts-menu routine, you need the following steps:1, download and install tomcat;2. Create an environmen
Struts Development Kit download (including source files and various documents), struts Development Kit
(1) I have searched for Struts Development kits of various versions for a long time, which are basically incomplete or unusable at all;
(2) After a long time, I finally found the official website and shared it with you:
Http://struts.apache.org/download.cgi#s
Working mechanism:
Struts workflow:
When the web application starts, the initialization actionservlet will be loaded, and the actionservlet will
Read configuration information in the struts-config.xml file and store them to various configuration objects
When the actionservlet receives a customer request, it will execute the following process.
-(1) retrieve the actionmapping instance that matches the us
Before learning about struts, let's take a look at what the open-source Java framework of Struts is doing? If we use this frameworkProgramWhat benefits do developers get? Here is a brief introduction:
Http://j2ee.masslight.com/Chapter4.html#mvc
Struts is a framework that promotes the use ofModel-View-ControllerArchitecture for designing large scale applications
1.The Struts dispatcher cannot be found. This are usually caused by using Struts tags without the associated filter. Strut
2.S tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher n
3.eeded for this tag. -[Unknown Location]
Reason: If you want to in the JSP file, using the tag of
This article is the author studies "Javaweb Introduction Classics" a book to tidy up the reading notes, only for the study and the reference. If you have related copyright issues, please contact the author in time
Overview of Struts 2 FrameworkThe Struts 2 framework originates from the WebWork framework and is an MVC framework. 1, MVC principle model, view, controller 2,
The Spring framework accomplishes the design tasks of the business layer, and the struts framework separates the presentation layer from the business layer, while the Hibernate framework provides flexible persistence layer support. The following is a description of the three framework integration environments:1, configuration Struts2.I, import the related jar package.II, modify the Web. xml file. The core control of STRUTS2 is an internship with a fil
when action after processing the class, in struts. XML Configure the file action . Configure action the purpose is to struts 2 know which action request to process. That is, to complete the user request and action .
in action You can specify result types , exception processor and interceptor, but only action name attributes must be specified, the attribute stone
For example: I set up an SSH project demo, the project structure as shown in the following diagram:
This project has a login interface, there is a login.jsp file, this file form form request is as follows
This form can also be written in this form
Configure the response action path in Struts-config.xml as follows
Here we find that the first URL path can be used in the form, this is the absolute path of the writing, the second is a relative pa
Struts 2 shoshould execute in the class associated with the recoverpassword action.
Note that method getUserPassword must be public and have no parameters. in Struts 2, by default, dynamic method invocation is allowed. any user of the web application can play around with calling your application's URLs trying to get Struts 2 to execute a method.
For more informa
Example of replacing struts labels with jstl-Struts full manual-hxzonjstl replacement examples
The following sections provide examples for replacing struts tag library tags with their jstl equivalents. Remember that not all the bean, HTML, and logic tags can be replaced by jstl tags.BEAN: Cookie replacement example
The following snippet shows the basic usage ofCo
development is under struts1.1, so the following describes the configuration of struts1.1 in JBuilder:
1. Download The jakarta-struts-1.1.zip package ;jakarta-struts-1.1-src.zip package
2. Unzip the jakarta-struts-1.1.zip package to the C:/jbuilder9/thirdparty directory and unzip the jakarta-struts-1.1-src.zip pack
This plug-in is used in struts applications.ProgramStart hibernate initialization, the original document hibernateplugin for struts, the steps are very simple:
1. Add in struts-config.xml:
Plug-in
Classname
= "Org. haree. Struts. hibernateplugin"
>
'Path-to-config-file' is relative to the root of
Detailed description of struts interceptor and struts interceptor1. Interceptor: The Struts2 interceptor intercepts a field before or after accessing an Action or Action. The Struts2 interceptor is pluggable and is an implementation of AOP.Explanation of WebWork Chinese document: the interceptor is the object for dynamically intercepting Action calls. It provides a mechanism for developers to define the cod
completely loosely coupled with the servlet Container2.attribute-driven and model-driven get data from forms on the page3, the use of the concept of interceptors to the servlet container to overcome the first 4 shortcomings4,struts1+webwork=struts2A first exampleTo write the steps:1 Create a Web project2 Copy Web. Xml from the Struts jar package into the above project 3 Create an ordinary Java class, and we are accustomed to write the last word 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.