Introduction to STRUTS2 (MVC framework) development

Source: Internet
Author: User

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--

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.