MySQL additions and deletions modification based on SSM implementation

Source: Internet
Author: User
Tags tomcat server

Before learning the Java Foundation, has not done any fun projects, the recent summer vacation, time is more idle, so I learned a bit recently in the enterprise practical application of the more popular SSM framework, based on this, through the network course, Learn to write a SSM based on the implementation of MySQL additions and deletions of the site, good nonsense not much to say, the following introduction to the project.

First of all, the UI of the page is built using the bootstrap framework, which is still relatively useful, not only fast, but also beautiful, style is flat. And for my this kind of English slag, there is a Chinese help document, simply not too good to start with, and then set up a good roughly like 1-1, of course, just static pages, the following data, button Button_Click events are written in the back.

Figure 1-1

then we will introduce the specific process of the SSM framework, because it is local access, not put on the networked server, so using Tomcat as a server, the project front-end initiated the request, sent to the SPRINGMVC Front controller, and then by the SPRINGMVC Front controller judgment, Whether it can be processed, can be processed, and then sent to the controller, can not process such as static pages and so on, directly sent to the Tomcat server, let the server to parse. Sends the data to the controller, and then calls the service layer's business logic. If you want to interact with the database layer, it will be handed to the DAO layer components, and the DAO layer of components are written with MyBatis, MyBatis , and so on to the database of a mapper, and the mapper of the files and interfaces are through MyBatis Generator (MBG) automatically generated, but because of the query time there are multiple table union query, so also in the XML file, the new two methods to implement a multi-table union query. At the same time, the basic additions and deletions are implemented via Ajax, the request is sent by Ajax, and then the JSON is returned, using JS to parse the JSON and display it in the page.

The project is dependency management using MAVEN, simply to download the jar packages needed for the project through MAVEN, and after the project is complete, you can build the war package with Maven to deploy the project on the real server instead of the mirror server in Eclipse.

General Construction said, said the project in the actual use of the attention point, in the addition of new employees in the front-end, the back-end of the method, you can greatly avoid the addition of dirty data, while using some regular expressions to determine whether the name and the mailbox is legitimate. The AJAX request sent by the front end, to be passed to the background processing, only need to add @responsebody and @requestmapping ("path suffix") on the method.

Finally, the implementation of the legend shows.

The implementation of the Employee Add feature:

Modify the implementation of the feature:

Implementation of a single deletion:

Bulk Delete:

  

Based on the SSM of the basic staff management system, the general functions are as shown, the implementation of the basic additions and deletions, the next step, if continue to improve, then add the landing page, and then publish the project to the Internet server, there is no landing page of the drawbacks too much, do not discuss, plus now are testing data, no practical significance , so do not consider publishing to the Internet temporarily.

  

MySQL additions and deletions modification based on SSM implementation

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.