Android Simple Login Registration service-side code implementation

Source: Internet
Author: User

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

Related Article

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.