China Travel Network project - three-tier architecture
table of Contents
1 Technical Selection
2 database
3 registration function
Technology Selection
1.1 Web layer
a) Servlet: front controller
b) html: view. This project is the project site, required for ordinary customers, need fast response, and therefore do not use jsp. These techniques generally used jsp website management background as a back-end office systems.
c) Filter: Filters
d) BeanUtils: Data encapsulation
e) Jackson: json serialization tool. Html so because of the use for data transmission, it requires the use of tools json sequence.
1.2 Service Layer
f) Javamail: java Send Mail Tools
g) Redis: nosql memory database
h) Jedis: java The redis client
1.3 Dao layer
i) Mysql: Database
j) Druid: database connection pool
k) JdbcTemplate: Spring of jdbc tool
2 database
Database folder in the resources file, travel.sql in.
3 registration function
3.1 Basic functions Registration Process
Note: When debugging found this page path is hard-coded, so the addition of a travel on the wrong path when deployed in a specific solution can refer to the Mu class network OA project
3.2 E-mail function is activated
you need to start the service before you can use, after opening to fill in their email account and authorization codes MailUtils.java class or login password, code, test code can have a test run first.
Content of the message and activation process as shown below:
4 login and logout
Landing page flow
5 Optimizing Servlet
5.1 BaseServlet
Servlet write a lot in the previous login registration may be considered to optimize
6 classification data show
6.1 cache data optimization
Since the classification of data
Classification of data after each page load will re-request to load the database, the pressure on the database is relatively large, and classification of data does not always produce change, redis can be used to cache all this data.