An explanation of a simple website Web project

Source: Internet
Author: User

There are incorrect terms, or bad understanding of the part, welcome to criticize, thank you!

Recently done website Web project, implement login function, query function. First, the project is divided into several modules to deal with, the current user module, the history of user modules, History module, database module, listener module. Followed the MVC design pattern.

(1) Database module: The first thing to do is a SQL file used to manipulate the MySQL database, A init.jsp initializes the button and returns information, a class of methods that perform INIT.SQL database operations, which the servlet uses to process the JSP request, and calls the method of the class to return a result of the JSP page after the process is completed.

Also make a database connection pool (use the class Initialcontext,datasource interface to get the connection)

(2) Current user module: JavaBean do this user's properties, set and Get methods, the DAO method class contains constructors to initialize the corresponding table in the MySQL connection, getUserId (), Getnamebyid (), Getidbyname () The method handles the data, two handles the login servlet, one checks for the presence of the user, then calls another check if it is already logged in, the JSP page is responsible for the login style, and the login displays the history user, the online user, the user record, the login user's button.

(3) Historical user module: Similar to the current user module, JavaBean contains user attributes and Set,get methods, the DAO method contains pagination display, the DAO method set the page and Count properties and pagination display method, Pageservlet is used to invoke the paging display method to process pagination, which is displayed on the JSP page.

(4) History module: Similar to the current user, only the JavaBean and DAO method classes and a JSP display page display the information of the visiting user

(5) Listener module: commons-logging and Log4j is a set of Api,apache Foundation developed for recording log files. Log4j is specialized in processing log files. No commons-logging,log4j is required to run. Create a new listener with multiple listeners that can listen for changes in the properties and listen for Request,session,context start and stop.

An explanation of a simple website Web project

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.