Long time does not write, the knowledge has forgotten! Now implement the simple login registration function for future reference!!!!
Project:
Https://github.com/majunm/TestServiceDemo.git
Server: tomcat/7.0.40 database: mysql5.0
Database creation: MySQL correctly installs the following interface after configuring path:
Mysql-u root-p//Connect MySQL Database
Create database july;//Creating DB database name July
show databases; View Database
Show CREATE DATABASE July; View Database Creation Details
Use july;//using July database
---------------Create a table---------------------
CREATE TABLE User (
ID int primary KEY auto_increment,
Username varchar (80),
Password varchar (200)
);
---------------Create a table---------------------
Show tables; View tables in the July database
Desc user;//View information for the user table
MySQL Visualization tool:
========================= Service-side code =======================
User
RegisterservletUserloginservletEncodefilter (Global encoding filtering)
Tool class:
CommonutilDatasourcemanagermd5utils
Database Connection Configuration:
Userdaoimpl
View Code
Web. XML configuration
Web. XML
Several JSP files:
register.jsplogin.jspindex.jsp
Access path:
http://localhost:8080/TestServiceDemo/
http://localhost:8080/TestServiceDemo/register.jsp//jump to the registration screen, fill out the form submission jump to Http://localhost:8080/TestServiceDemo/register
Http://localhost:8080/TestServiceDemo/register//corresponding register servlet
http://localhost:8080/TestServiceDemo/login.jsp
http://localhost:8080/TestServiceDemo/login//Ibid.
The path configuration is based on Web. XML!!!!!!!!!!
The code has the following organizational structure:
Android Simple Login Registration service-side code implementation