Use Java to implement mailbox validation and activation

Source: Internet
Author: User
Tags thread class

1. Required jar files

2. New packages required

description:DAO"Interface: Entity and data Interaction",entity"Solid class",filter"Filter",Service "Interface: The business layer, the same method as the DAO layer, except that the DAO layer directly connects to the database, and it is called DAO Layer Method ", servlet " JSP Some processing of the page ", util "Some tool classes"

3. new jsp file

Description:index.jsp"Login Interface",regmail"Registration page",activesuc.jsp"Activation Success page"

4. Business process:

Newregmail.jsp→Regservlet.java (GetJSPin the pageName,psw,mail,Create a new one based on these three fields plus activation status and activation codeUsersthe entity class)→Regservlet (The field that will getSetto a new definition ofUser, the activation code is randomly generated.(under the tool classUuidutil.java))→Registerservice (Interface)Business layer →Registerserviceimp (Implementation Class)calledDAOmethod of layer interface →Registerdao (Interface)→Registerdaoimp (Implementation Class)→ create a new method that interacts with the data and, if the data is inserted successfully, returns aUserobjects →Regservlet (judging the returnedUseris empty, not emptyStartunder the Tools classSendemailthreadThread Class)→ Mail sent successfully to email click on the link →ActiveservletThe link now takes a parameterActive→Registerservice (Interface)Business Layer(Pass the activation code as a parameter to determine if the activation code exists.)→Registerserviceimp (Implementation Class)calledDAOmethod of layer interface →Registerdao (Interface)→Registerdaoimp (Implementation Class)→ create a new method to interact with the data without finding the user to return0, the knot is activated to return2, activation successfully returns1→ The return value exists in the container passed toActivesucpage → on the page to determine the value(after successful activation jump to go to)→index.jsp (Login Interface)→Loginservlet (calledServicelayer ofLoginMethod)→Registerserviceimp (Implementation Class)calledDAOmethod of layer interface →Registerdao (Interface)→Registerdaoimp (Implementation Class)→ create new method to interact with data, login legal returnrun.query (), if the1Description Legal The rest is illegal →Loginservlet (make judgments, if for1The login succeeds, or theindex.jsppage Output error message)

Use Java to implement mailbox validation and activation

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.