Servlet+jsp+javabean development Model (MVC) Introduction

Source: Internet
Author: User

So sad ... Write login before you see a good blog post, no collection, and then can not find.

A few days ago I saw a problem and when I felt the most powerless.

The previous two days have been trying to answer: tried all the Google solve case, the result bug is still.

Today wants to answer: Obviously met, just can't find the article. Cry!

================================================

Learn MVC pattern (actually JSP job), of course, this is not just servlet+jsp+javabean a case, it is a kind of thought, realizes the function division of the web system.

For JSPs:

Model layer: Implement the business logic of the system, that is, the JavaBean part

View layer: Responsible for interacting with the user, that is, to display the data objects on the interface to the user, i.e. html,jsp

Control layer: A bridge between model and view that can dispatch a user's request and select the appropriate view for display, and it can also interpret the user's input and map them as executable operations of the model layer, which is, of course, the responsibility of the servlet.

It must be incomprehensible to say so:

Very image ah have wood has. In layman's words, all HTTP requests made by the Web Broswer through the View layer's JSP page should be given to the servlet, the control layer. The servlet obtains processing results by processing the JavaBean, the core model layer, and then returns to the JSP page of the view layer. The JSP page returns to the browser's last HTML page.

Is it still a little blurry ... In fact, see an example to know ...

=======================================================

Servlet+jsp+javabean MVC mode Implements login Registration function:

First look at the overall layout:

The structure of the whole system is probably:

All right. Did not seem to have achieved the desired effect. "I always thought I'd draw a picture ..."

Then the Web. XML is configured. Of course, I only deserve the simplest and most necessary:

Then, we have a general understanding of this most classic MVC pattern.

Well. And then there's no more.

Servlet+jsp+javabean development Model (MVC) Introduction

Related Article

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.