Jsp+mysql implementation of the Web site login and registration of small cases _jsp programming

Source: Internet
Author: User

In order to practicing, I have tried to do a website login and registration of a small case. Because there is no landscaping processing, so the interface is not very good-looking.

The functions of Web site implementation are as follows:
• User first registration function
• User Login function

I'll show you the module below.

Registration module

First you need a registration interface, as follows register.jsp:

 <%@ page language= "java" contenttype= "text/html" Charset=utf-8 "pageencoding=" Utf-8 "%> <!
DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >  
  

The

Then is the registration processing page for the action, as follows do_register.jsp:

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" utf-8 "%> <%@ page import=" java.sql.* "%> <!
DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >  

Small summary:
Deficiencies:
• For the operation of the database is not good enough, there is no timely use of resources to shut down, should be timely for those unused open resources to close operations, release resources.
• The interface effect is not good enough, response output is prior to out of the output.
• Database operation is too cumbersome, should be integrated, do a special processing database Operations Toolkit to achieve good reuse of code!

Login Module

The first is the login interface, login.jsp, I added a hyperlink (intention is to let login.jsp as a portal page, to achieve registration of the effect of a single, although the two are not combined, and the registration interface is too simple), we first gather together to see it.

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" Utf-8 "%> <!
DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >  

Then the processing page for the logon information, do_login.jsp:

<% @page import= "Java.sql.DriverManager"%> <%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" utf-8 "%> <%@ page import=" java.sql.* "%> <!
DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >  

For landing successful users, jump to the successful landing interface login_success.jsp:

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "
 pageencoding=" Utf-8 "%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
 
 

For users who fail to login, make a warm page prompt, login.failed.jsp:

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "
 pageencoding=" Utf-8 "%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
 
 

Big Summary:

The progress of the Department:
• Use of the Session object to store the user login name information, to achieve the information between the page interaction
• With MySQL, to a certain extent experience the JEE mode

Deficiencies:
• The code is too cumbersome and not good for reuse
• Resource utilization is not high, the use of unused resources to be closed in a timely manner. Although the Java Virtual machine has automatic garbage collection mechanism, but it is best to develop good habits!
• Interface control is not good enough, poor experience, lack of thinking

Where to improve:
• With a more complex user registry, it's better to do it in a bean way
• Modularity, using the concept of MVC
• Improve interface permissions to prevent hotlinking
• Add other features such as uploading files, downloading files, and enriching the site.

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.