Spring MVC (1) Why use MVC

Source: Internet
Author: User

Before using spring MVC, let's first understand why we're using spring MVC. We can look at the simple development of Java Web in this question.

1. The servlet development phase

In the 90 's, with the rapid development of Internet and browser, the B/S model based on the browser developed with the hot development. Sun proposes a servlet system that enables Java programmers to develop Web applications based on the B/S architecture, using servlet classes to encapsulate HTTP requests and responses in standard Java classes to implement a variety of Web application scenarios.

One problem with Servlets is that the output of the page is returned through the Servlet class, which makes it easy to develop various page effects and colorful styles .

So Sun borrowed from ASP to launch the JSP

2.jsp Development phase

When the JSP is introduced, the Java programmer can add the server code to the static page which has been designed by the designer, and then the JSP file is automatically parsed by a JSP container and converted into a servlet class to be run by the Web servers. JSP understanding is to design the display page first, and then turn the display page into the servlet output.

The use of JSP to improve the development efficiency, but there are still some problems: first page has a large number of Java logic Code, front-end artists in the maintenance is to consider these logic code, and Java programmers in maintaining Java code is to consider the front-end display logic.

So Sun introduced the MVC pattern

3.MVC Development phase

The MVC pattern divides the program into three modules: a data Module (model), a Business logic module (Controller), and a display module (view). The Business Logic Module (Controller) accepts the request, processes the business logic, eventually generates the data (model), the Display module (view) accepts the data (model) renders the page, and finally returns the display content.

This separates the business logic processing from the display rendering and is associated with the data module.

Spring MVC (1) Why use MVC

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.