JSP _ implements Servlet login, registration, and connection to Mysql database. _ MySQL

Source: Internet
Author: User
JSP _ implements Servlet login, registration, and connection to Mysql database. Http://blog.csdn.net/svitter in this article

It is also an MVC instance.

Source code: http://download.csdn.net/detail/svitter/7532621


User. SQL:

-- PhpMyAdmin SQL Dump -- version phpStudy 2014 -- http://www.phpmyadmin.net---- Host: localhost -- generation date: June 21, 2014 -- Server version: 5.5.38 -- PHP version: 5.3.28SET SQL _MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+ ";/*! 40101 SET @ OLD_CHARACTER_SET_CLIENT = @ CHARACTER_SET_CLIENT */;/*! 40101 SET @ OLD_CHARACTER_SET_RESULTS = @ CHARACTER_SET_RESULTS */;/*! 40101 SET @ OLD_COLLATION_CONNECTION = @ COLLATION_CONNECTION */;/*! 40101 set names utf8 */; ---- database: 'users' ---- orders TABLE structure 'Ur '-- create table if not exists 'Ur' ('name' varchar (255) not null, 'passwd' varchar (255) not null, 'id' bigint (20) not null AUTO_INCREMENT, primary key ('id ')) ENGINE = MyISAM default charset = gbk AUTO_INCREMENT = 2; ---- 'ur' -- insert into 'ur' ('name', 'passwd', 'id ') VALUES ('A ',' A', 1 );/*! 40101 SET CHARACTER_SET_CLIENT = @ OLD_CHARACTER_SET_CLIENT */;/*! 40101 SET CHARACTER_SET_RESULTS = @ OLD_CHARACTER_SET_RESULTS */;/*! 40101 SET COLLATION_CONNECTION = @ OLD_COLLATION_CONNECTION */;

Web. xml:

 
   
  
   
JSP_servlet_javabean
  
  
   
    
Configure the Servlet used for login logging
   
   
    
LoginServlet
   
   
    
LoginServlet
   
   
    
LoginServlet
   
    
  
   
    
LoginServlet
   
   
    
/LoginServlet
   
  
  
   
    
Configure the Servlet used for registration with slave
   
   
    
RegisterServlet
   
   
    
RegisterServlet
   
   
    
RegisterServlet
   
    
  
   
    
RegisterServlet
   
   
    
/RegisterServlet
   
  
      
   
    
Login.html
     
  
 

Lib:

Mysql-connector-java.jar;

Mysql-connector-java-5.1.17.jar;


Login.html:

Login.html
 
 
 

LoginCheck. jsp:

<% @ Page language = "java" contentType = "text/html; charset = UTF-8" pageEncoding = "UTF-8" %>
 Insert title here<% String checkLogin = (String) (request. getAttribute ("checkLogin"); %>

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.