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