1. Framework Overview:
Encapsulate repetitive, cumbersome code.
2, three-tier architecture and Struts2
Presentation layer: M model V View C control
Business Layer: Service
Persistence layer: DAO data Access Object Persistence layer is also called the data access layer
The position of the Struts2 in the three-tier architecture is in the presentation layer. Note that it is just a presentation layer framework.
(Interfaces between layers and layers for the purpose of reducing coupling, called interface-oriented programming)
3. Mvc and Struts2
Controller: Servlet
Init ()
Destroy ()
Service (Servletrequest,servletresponse)
Filter: Filter It can also be used as a controller.
Init (Filterconfig)
Destroy ()
Service (Servletrequest,servletresponse,filterchain)
The filter can be done by the servlet and is more powerful than the servlet. It has one more release function.
4, Struts2 must use JAR package
5, build the development environment
5.1 Download the Development Kit
5.2 Building the environment
A. Import the required Jar packages
B. Create a configuration file
Under the top-level classpath, create a name called Struts.xml file
6, the first case of the implementation process
Customer Browser--