Java Advanced Learning 14th Day--MVC development process

Source: Internet
Author: User

the compilation of MVC cases
  • Database: Temporarily use XML as a database
  • Technology
    • Servlet + JavaBean + JSP
    • Encapsulating data
      • Beanutils
    • In the JSP display
      • JSTL + JSP
    • Parsing xml
      • DOM4J Parsing xml
  • Environment preparation

    • Create a new Web project, import a jar package
    • Create a database, create a user.xml file on disk
  • Requirements to complete registration

    • Registration Form (case)
    • Database (NO)
      • Use XML instead.
    • Architecture
      Servlet + JSP + JavaBean
    • Technology
      • Parsing XML using DOM4J technology
      • Servlet Technology
      • Beanutils Technology
      • Jstl+el-expression
    • Create a new project
    • Importing JAR Packages
    • Creating a Package structure
  • Step 1 of development

    • Write a registered page,
      Username, password, confirm password, alias, email, Verification code
    • Complete the validation onsubmit() of the data first
      • Cannot be empty, the password and the confirmation password are the same
      • The mailbox is formatted correctly (regular expression)
    • Send requests, request Servlets, receive data, encapsulate, process data
    • displayed on the JSP.
  • MVC development Process

  • C: Control layer (receive requests and parameters sent from the client)

    • Receive parameters (Request object)
    • For ease of operation (encapsulating data, introspection, beanutils open source tools)
    • Own new User (); USER.SETXXX data
    • Complete the Code of Business logic (not recommended written in servlet) written in New UserService ();
    • Receives the result, sends the displayed data to the JSP through the result. (The result is stored in a domain object)
  • M: Model layer (JavaBean package data, other JavaBean processing business)

    • Process business logic According to the registered functionality. (User name can not duplicate, mailbox cannot duplicate)
    • Need to return the results.
  • V: View layer (complete display of data)

    • To the JSP page, the value of the field is taken from the El expression.


MVC Registration Case
    • Features to implement registration

    • The ability to implement duplicate names and mailboxes

      • Need to parse text content (user name and mailbox) from XML
      • Compared to the values passed in, if the same, cannot register, if not the same, can register.
    • Add a one-time verification code
    • Realize the function of landing
    • Implement login function Remember user name
    • Implement login function remember Chinese user name

Java Advanced Learning 14th Day--MVC development process

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.