[Original]java Web Learning Note 20: Case Complete Practice (Part 1)---MVC architecture analysis

Source: Internet
Author: User

this blog is original: Integrated still Silicon Valley (http://www.atguigu.com) System tutorial (deep thank) and network of existing resources (blogs, documents, books, etc.), the source of resources I will markThe purpose of this blog: ① summary of their own learning process, equivalent to study notes ② to share their own experience to everyone, learn from each other, communication, not commercialcontent inevitably appear problems, welcome to correct, exchange, discussion, you can leave a message, can also be contacted by the following ways. I Internet technology enthusiasts, Internet technology enthusiastsWeibo: Ivan is in 0221qq:951226918

--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- -----------------------------

1.MVC Case Requirement Analysis: using MVC design pattern to add and revise a data table

1) There is no business layer, and DAO is called directly by the Servlet, so there is no transactional operation. So you can get the Connection object directly in the DAO

2) Adopt MVC design pattern

3) Use of the technology (technology selection)

①MVC design mode: JSP, Servlet,pojo

② Database using MySQL

③ Connection database requires use of C3P0 database connection pool

④jdbc Tool with Dbutils

⑤ the prompt action on the page using JQuery

4) Technical Difficulties

① How do multiple requests use a Servlet?

② how to blur a query?

③ How can I verify that the user name has been used and is prompted in the case of creation or modification?

2.MVC Architecture ( the order in which code is designed and written: Design table structure, DAO--business layer, view layer )

  

 1) view:jsp

① rendering data: Get the attributes that the Servlet puts in from Reuqes

② receiving input from user

③ write the JS code to give the corresponding hints

   

2) Controller:servlet

① GET request information: GET request parameters

② verifying the legality of request parameters: validation failed, need to return page, and give prompt information

③ encapsulates the request parameter as a JavaBean

④ call the DAO method to get the returned result

⑤ put the returned results into the request

⑥ Response page: forwarding, redirection

3) Model:dao

① Getting a database connection

② Performing CRUD operations

③ return Results

  

4) Model:mysql for storing data

2. Next section: Case Complete Practice (Part 2)---. DAO Layer Design

[Original]java Web Learning Note 20: Case Complete Practice (Part 1)---MVC architecture analysis

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.