Implementation of a registration and login system
Github: https://github.com/BgirlStar/lazyDemo
Functional requirements: the project mainly realizes the functions of login and registration of the foreground users and displaying all the registration information of the users, and the function of modifying and adding query to the comparison data of the background database.
Development tools: mysql,eclipse (jdk and tomcat are configured)
Logical design: build the development environment to create the web project import project required development package, create the package name, in java is to package to reflect the hierarchical architecture of the project first to establish an entity class, encapsulating the required attributes. The table is then created in the database and the data can be inserted. Create a database connection and add the necessary functions such as modifying queries. The dao layer is established and the dao interface is realized with daoimpl. Then establish the biz interface, inherit the daoimpl implementation biz to complete the business logic layer. Then write the login and registration servlet classes respectively. And it is configured in web.xml. Finally, draw the page, a login interface, a registration interface, a login success interface, a registration successful display of all the information interface.
Problem solving: garbled problem, request.setCharacterEncoding () is how you set the encoding to get the data, and response.setContentType () sets the MIME and encoding when you respond. The coding format of the two should be kept consistent.