a
,Struts2 Introduction
1.Struts2 Overview
Struts2 is the MVC Open source framework that Apache releases. Note: It is just a presentation layer (MVC) framework.
2, The origin of Struts2
Struts1: A set of MVC Open source frameworks developed by Apache . It was very popular 2005 years ago.
Cons:Struts1 's core controller is a Servlet. As the number of users increases, the drawbacks begin to emerge.
struts2: in There is a design-ahead framework xwork xwork1 and webwork2 struts2 apache Opensymphony the organization was developed. It contains the webwork2 core and struts some features and functions. In addition, and struts1 nothing.
Vi. Building Struts2 development environment
1. Download Struts2 Development Package
http://struts.apache.org
2. Development package Directory Structure
3, build the development environment
3.1, copy the necessary jar packages into the classpath
What jar packages are copied?
Find Struts2 's own example,struts-blank 's War package, in its \web-inf\lib full copy of the jar package under the directory .
3.2, setting up the Struts2 configuration file
At the top of Classpath(on the top-most build path), Create a configuration file with the default name of Struts.xml .
Attention:
1. The file name is case-sensitive.
2. Create a location.
3. This name allows for modification, but we generally do not change it.
3.3, configuring the controller
A. Configuration location: In Web . xml
b, configure what: struts2 has written a filter.
Conclusion:
One embodiment of STRUTS2 's excellence than struts1 is that it uses a more powerful filter as a controller.
3.4, verify success
Deploy the app, start Tomcat, and no error indicates a successful build.
01struts2-01 Introduction to Java Learning and environment construction