2014年5月14日星期三

[ Source ] Dangdang full source code ( with mail verification function )

 This post last edited by the defonds on 2014-03-18 10:53:49
1. Projects
typical e-commerce system ( online shopping platform ) . Dangdang system simulates some features .
2. functional requirements
1) user management module ( 3 days ) user
realized login, registration function
2) Products Module ( 2 days ) main
achieve the main interface and category browsing
3) shopping cart module ( 1.5 days ) cart
to buy it , the number of changes , delete functions
4) generate orders module ( 1.5 days ) order
order confirmation , fill in the shipping address , function generate orders
3. Technique
1) Technical Architecture
Struts2, JDBC ( connection pools ), jQuery, Ajax
2) design ideas
MVC and hierarchical design ideas
a display layer :. JSP components (jQuery, Ajax) .
b control layer : Struts2 controller components , Action Component
c business layer :. Bean Components
d Data Access Layer :. DAO component (JDBC)

4. database design
1) Database import
create database dangdang; / / Create a library
use dangdang; / / enter dangdang library
set names utf8; / / set the connection and send SQL coding
source path / dangdang.sql; / / import the sql file
2) Data table function
a.d_user ( user information table )
stores user information, login and registration functions involving
b.d_receive_address ( shipping address information table )
stores shipping address information, fill out the shipping address function involving
c.d_category ( Class Information Sheet )
category information stored books involving the left main interface menu features category
d.d_book ( Book Information Sheet )
book stores specific information , browsing and other functions related to product
e.d_product ( Product Information Sheet )
storing various types of products common information field.
f.d_category_product ( category and product mapping table )
stores and products containing relations between classes , involving product browsing
g. d_order ( Order Information Sheet )
stores order information, involve creating order functions
h. d_item ( Order Details )
stores product information in the purchase order , involves creating order functions.

5. structures engineering structures
1) the need to introduce development package
struts2 Development Kit
jdbc Development Kit
dbcp connection pool Development Kit
2) src file structure
org.tarena.dang.action: control layer action of the user module :
org.tarena.dang.action.user
org.tarena.dang.action.main: Products of action
org.tarena.dang.action.order: Orders for action
org.tarena.dang.action.cart: shopping cart action
org.tarena.dang.service: business layer
org.tarena.dang.dao: Data Access Layer
org.tarena.dang.entity: entity class
org.tarena.dang.util: Tools
org.tarena.dang.interceptor: Interceptor
3) struts configuration file structure
web.xml ( Configuration Filter Controller )
struts.xml (struts main configuration file )
struts-user.xml ( user module configuration file )
struts-main.xml ( Read module configuration file )
struts-order.xml ( Orders module configuration file )
struts-cart.xml ( shopping cart module configuration file )

4) WebRoot file structure
/ user / *: User Management JSP
/ cart / *: JSP shopping cart
/ order / *: JSP Order
/ main / *: product browsing JSP
/ common / *: headers, footers and other common JSP
/ js / *: Place js script file
/ css / *: place the css style file
/ images / *: Place page image files
/ productImages / *: Place Product Image
Advantages
----------------- ----------------- connection pool
a. Connection object can manage and control the Connection number in a safe range. Improve access security database.
b. connection pool of Connection objects remain connected with the database , to avoid frequent connections created and destroyed .

============ user management module ==============
1. registration requirements
1) form validation ( using js + Ajax)
Email: non-empty , format, uniqueness (ajax)
Nickname: non-empty , the format
Password: non-empty , the format
Confirm Password: non-empty , consistent with the password
verification code : non-empty , correctness (ajax)

2) information into the form data sheet d_user
entity class writing , DAO, Action
3) send a verification code to the user's mailbox
introduced commons-email.jar, email.jar
reference EmailUtil tools code
4) into the mailbox authentication page verify_form.jsp

2. mail verification
1) Forms Authentication
verification code : non-empty , correctness (ajax)
right after the jump to success prompt interface : window.location = "register_ok.jsp";
2) Action Logic
a. use verification code to d_user check .
b if correct, will update is_email_verify field d_user into Y; incorrect verify_form.jsp prompted "Authentication failed"
c. jumps to register_ok.jsp
3. User Login
1) Forms Authentication
Email: non-empty , the format
Password: non-empty
2) Action Logic
a. Detection Email and password are correct , failed back login_form.jsp Tips
b. detection is_email_verify mailbox is validated, not by going verify_form.jsp
c. last_login_time update last login time and IP address last_login_ip.
d. the user information into the session.
e. correctly enter / main / main.jsp
4.main.jsp page header section , showing the status of the user is logged in
If a user is logged in, display the "Welcome XXX, [ Logout ]"
If the user is not logged Show "[ Login ] [ Register ]"

database model

Home Show :



registration page :

Verify E-mail:

authentication is successful :

user login status:




In fact, there are many defects in the project need to complete projects , we can modify , which has a bug on the shopping cart , into question , we all look for it

Baidu network disk download http://pan.baidu.com/s/1i3sT5WT

Database Download : http://pan.baidu.com/s/1ntLlGCh


------ Solution ------------------------------------ --------
I was a novice , just to learn , thanks for sharing ! ! !
------ For reference only -------------------------------------- -

---- - For reference only ---------------------------------------
good for novice practice hand
------ For reference only ----------------------------------- ----

- ----- For reference only ---------------------------------------
often share a recent project , good good
------ For reference only ------------------------------------ ---
UI vivid
------ For reference only ------------------------------ ---------
preserved , after using
------ For reference only --------------------- ------------------
this too cattle X , right
------ For reference only ----------- ----------------------------
  The reply was deleted administrator at 2014-03-18 13:23:34

------ For reference only ---------------------------------- -----
good, are learning Struts2, look down !
------ For reference only -------------------------------------- - teaching Case
a training school for beginners to learn
------ For reference only ----------------------- ----------------
I give you praise Oh thirty-two
------ For reference only ---------------------------------------
good resource to go from ah
------ For reference only ------------------------------------- -
there must be fire code , see posts do not reply to all written code bug constantly
------ For reference only ----------------- ----------------------

------ For reference only ------------------------ ---------------
fit to practice hand. . .
------ For reference only -------------------------------------- -
  The reply was deleted administrator at 2014-03-18 13:41:20

------ For reference only ---------------------------------- -----
download , including spare
------ For reference only ------------------------ ---------------
  The reply was deleted administrator at 2014-03-18 14:16:11

------ For reference only ---------------------------------- -----
fit fast out
------ For reference only -------------------------- -------------
download, and leave India .
------ For reference only -------------------------------------- -

------ For reference only ---------------------------------------

Thanks for sharing .
take a look at what to pay attention to development projects .
------ For reference only -------------------------------------- -
good information ah ! ! !
------ For reference only -------------------------------------- -


good information ah ! ! !
------ For reference only -------------------------------------- -
of the graduation project .
------ For reference only -------------------------------------- -
good resource
- ---- For reference only ---------------------------------------
java is there no . net of ?
------ For reference only ----------------------------- ----------

------ For reference only ------------------------------------ --- under
good learning
------ For reference only ---------------------------------------

------ For reference only ---------------------------------------

------ For reference to support only ---------------------------------------

------ For reference only ---------------------------------------
 learn.
------ For reference only -------------------------------------- -

---- - For reference only ---------------------------------------
very good, learn
------ For reference only ------------------------------------- -
good! !

------ For reference only ---------------------------- -----------
it has . . Learn next. Good Dongdong
------ For reference only ---------------------------------- -----
nice! Like this one !
------ For reference only -------------------------------------- -
good, very powerful ah
------ For reference only ----------------------------- ----------
up inside ? ? ? ?
------ For reference only ------------------------------ ---------
should be more famous website templates .
------ For reference only -------------------------------------- -


Blessings
------ For reference Dangdang you only ---------------------------------------
say (⊙ o ⊙)?
------ For reference only -------------------------------------- -
it is not within reach ..... 3 years ago
------ For reference only ---------------------------------------
retrospect really good Cana . . . . .
------ For reference only -------------------------------------- -

Well last year . . .
------ For reference only -------------------------------------- -
good things , the landlord refueling.
------ For reference only -------------------------------------- -
great, thank you landlord
------ For reference only ----------------------------- ----------

Well last year . . .  
I reached the end of 2010 have done in this stuff . . In retrospect almost cried . .
but did not think I still have not updated curriculum . .

没有评论:

发表评论