Struts2 notes 01--basic MVC architecture

Source: Internet
Author: User

Original content: Https://www.tutorialspoint.com/struts_2/basic_mvc_architecture.htm

Apache Struts 2 is an elegant, extensible framework for creating enterprise-class Java Web applications, originally known as WebWork 2.

The purpose of this framework is to simplify the development cycle of the entire Web application, from build to deployment, and subsequent maintenance work.

The following tutorial will teach you in simple steps-how to create an enterprise-level Java Web application using Apache struts.

Audience

This tutorial is designed for Java programmers who want to understand the Struts 2.x framework and its applications , and it will bring you a moderate level of experimentation.

Prerequisite conditions

Before doing this tutorial, you need to have a better understanding of the Java programming language.

A basic understanding of the MVC Framework and JSP or servlet will help you learn.

Basic MVC Architecture

MVC is a design pattern for developing Web applications . This pattern consists of the following three parts:

    • Model-the lowest level of the pattern, responsible for data maintenance.

    • View -is responsible for displaying the data to the user.

    • Controller -responsible for interaction between the model and the view.

MVC is popular because it separates the "user Interface" and "program logic" and supports separation. --controller accepts user requests, prepares the data required for the view with model, and finally generates a visual response from view.

Model

The model is responsible for managing the application's data, which responds to requests for views, instructions from the controller, and updates itself on this basis.

View

Presenting data in a specific format requires a controller trigger;

is a script-based template system, common views are jsp,asp,php , ETC.,

Very easy to integrate with AJAX technology.

Controller

The controller is responsible for responding to user input and interacting with data model objects. It accepts input, validates input, and then performs a business operation that modifies the state of the data model.

Struts2 is an MVC-based framework. in the next section, let's look at-how to use the MVC method in Struts2.

Struts2 notes 01--basic MVC Architecture (GO)

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.