论文总字数:37249字
摘 要
相信电子商务的概念已为大多数人熟知,具《中国电子商务市场数据监测报告》统计2017上半年,中国电商行业的成交额13.35万亿元,居世界首位。其中电商龙头企业“阿里巴巴”甚至将“双十一”变成一个全民狂欢购物的节日。政策继续加持,体系已较为完备,电商不断创造着新的消费需求,开辟了就业增收新渠道,为大众创业、万众创新提供了空间与舞台。由此可见电子商务的沃土催生了一批新兴产业与技术的发展。目前,基于web技术实现的电商网络平台是比较主流的架构,广泛应用PC端与移动端。整体采用三层B/S架构,兼具易于开发和移植性强的优点,其维护与运营成本相对较低,适用于中小型企业,符合全民电商的总趋势。
本系统基于Web技术开发,目前用于web开发的语言中java具有独天得厚的优势。其具有的跨平台性和可移植性都为前期开发和后期的维护提供了极大的便利性。由于java提供的种类丰富的API,为企业节省人力资源的成本,同时缩短软件开发周期,延长软件寿命。本次课题旨在运用web技术来开发一个图书销售系统,其考验的是对语言的熟悉程度,以及各主流框架的运用。同时还要考虑与其他第三方软件的兼容性,如mysql数据库,tomcat服务器等。整个项目分为多个模块,重点在于登录注册模块,购物车模块和后台管理模块。要实现以上构想,需要在B/S架构下进行整合实现。得益于java提供的API可以与数据库与浏览器等进行交互,同时还可以使用Spring MVC,Mybatis等框架对功能模块进行构建。总体来说,对这些框架和第三方软件的熟练度决定了软件品质的优劣。
本次设计旨在利用html5协议中的部分技术实现搭建一个基本的图书销售系统。利用SpringMVC模式进行构建,前台实现了用户注册、登录、查询商品、下单购买、购物车管理等基本功能。后台部分主要是商品数据的更新、用户信息管理、商品信息管理等功能。本次设计用到的开发工具主要有,IDE:MyEclipse(JDK1.7版本),服务器为tomcat v7.0.,后台数据库是MySql。本次设计严格按照SpringMVC模式标准进行设计开发,实现各个模块间高内聚低耦合的基本要求。后期代码重构时分离业务层、持久层、和控制层,达到SpringMVC设计模式解耦的目的。同时优化代码,使其精简,提高可读性。
关键词:SpringMVC ;B/S架构;数据库;Mybatis
Abstract
It is believed that the concept of e-commerce is well-known to most people. According to the "China e-commerce market data monitoring report," statistics for the first half of 2017, the turnover of China"s e-commerce industry was 13.35 trillion yuan, ranking first in the world. Among them, E-commerce leading enterprise “Alibaba” even turned “Double 11” into a holiday for people’s carnival shopping.The policy continues to bless, the system is relatively complete, e-commerce continues to create new consumer demand, opened up new channels for employment increase, and provided space and a stage for popular entrepreneurship and innovation.This shows that the fertile soil of e-commerce has spawned a number of new industries and technologies.At present, the e-commerce network platform based on web technology is a more mainstream architecture and is widely used in PCs and mobiles.The overall use of a three-tier B/S architecture has the advantages of easy development and portability. Its maintenance and operating costs are relatively low. It is suitable for small and medium-sized enterprises and meets the general trend of all-people e-commerce.
This system is based on Web technology development. Java currently used in web development has a unique advantage.Its cross-platform nature and portability provide great convenience for early development and later maintenance.Thanks to the rich variety of APIs provided by Java, the company saves the cost of human resources, while shortening the software development cycle and extending the software life.This project aims to use web technology to develop a book sales system. Its test is familiarity with language and the use of various mainstream frameworks.Also consider the compatibility with other third-party software, such as mysql database, tomcat server and so on.The entire project is divided into a number of modules, the focus is on login registration module, shopping cart module and back-office management module.To realize the above ideas, we need to implement integration under the B/S architecture.Thanks to the API provided by Java, you can interact with databases and browsers, and you can use Spring MVC, Mybatis and other frameworks to build functional modules.In general, the proficiency of these frameworks and third-party software determines the quality of the software.
This design aims to use the part of the html5 protocol to achieve a basic book sales system.Built using the SpringMVC model, the front desk implements basic functions such as user registration, login, query of merchandise, order purchase, and shopping cart management.The background part is mainly the update of product data, user information management, product information management and other functions.The development tools used in this design are mainly IDE: MyEclipse (JDK 1.7 version), the server is tomcat v7.0. The background database is MySql.This design is designed and developed in strict accordance with the Spring MVC model standard, and the basic requirements for high cohesion and low coupling between modules are achieved.In the later code refactoring, the business layer, persistence layer, and control layer are separated to achieve the purpose of decoupling the Spring MVC design pattern. At the same time, the code is optimized to make it simpler and more readable.
Keyword:SpringMVC;B/S;DataBase;Mybatis
目 录
- 绪论···········································································1
1.1 选题背景·······································································1
1.2 研究网络商城的目的·····························································1
1.3 网上商城的前景·································································2
- 技术背景········································································2
2.1 HTML5协议····································································2
2.2 SpingMVC技术简介······························································2
2.3 JSP技术简介····································································3
2.4 数据库技术简介·································································3
2.5 Tomcat服务器···································································3
- 需求分析········································································3
3.1 可行性分析······································································4
3.1.1经济可行性·································································4
3.1.2 技术可行性·································································4
3.1.3 操作可行性································································4
3.2 功能需求分析····································································5
3.2.1 系统活动图································································5
3.2.2 前台模块分析·······························································5
3.2.3 后台模块分析······························································6
3.3 系统性能分析····································································6
第4章 系统设计·········································································7
4.1 系统结构设计····································································9
4.2 数据库设计·····································································10
4.2.1 关系数据库设计····························································10
4.2.2 数据表设计·······························································11
第5章 系统实现···································································11
5.1 系统文件的配置·······················································11
5.1.1 pom.xml的配置······················································13
5.1.2 web.xml的配置·····················································15
5.1.3 ApplicationContext.xml的配置·········································16
5.2 数据库连接····································································18
5.2.1数据库配置文件····························································18
5.2.2持久层配置文件····························································19
5.3 登录注册界面···································································20
5.4 用户信息界面·····························································24
5.5 订单界面·····································································25结 语····································································32
致 谢··········································································33
绪论
目前在国内,网上商城,网络购物被称为电商,即电子商务。当然电子商务是一个泛化概念,再此不予深究。网上商城实际上是通过万维网连接,实现商品交易的行为。其优势是受空间和时间的限制极小,同时降低商品交易的成本,这也是其优势所在。故人们可以享受到比传统商业形式带来的优惠与便利。
1.1选题背景
据不完全统计,中国庞大的人口基数带来了巨量的网民数量,其中大概有将近60%的比例。其中可能会上网购物的网名数量所占比大概为20%。如此多的人口基数加之电子商务本身的便利性,是推动其迅猛发展的关键所在。同时也催生了一批新技术的发展。
对于网络购物而言,最主要的方便快捷,对普通民如此,对于开发者也是同样的。B/S架构的便利性很大程度上契合和电子商务发展的趋势。目前开发电商网站主流技术就是java,JavaScript。在配合一些主流框架,列如SpringMVC,jQuery等。使得开发成本和难度都有所降低。
1.2研究网上商城的目的
作为一种新兴的经济体,网络商城的出现冲击了传统产业模式。新的事物代替老的事物必有其理由。首先是互联网技术的发展。使其得到了充分的技术支持。同时人类进入信息时代以后生活节奏明显加快。这体现在了生活的方方面面。现代社会讲究的是快速高效,当一种更加快速高效的事物出现时,原有的生活方式很快就会遭到淘汰。这也是历史发展趋势。网络商城是的人们的购物不在受时间和空间的限制,解放了部分时间,就可以完成更多的工作,推动社会发展。对整个市场经济来说吗,一个新的经济体是实现资源从新配置的机会。
1.3网上商城的前景
当然,每一种新兴模式的出现总不会是完美的,它既是顺应历史时代的出现,也有自身的一些缺陷与问题。首先,这种新模式的出现冲击了传统产业,如零售业是重灾区。再短时间内势必会造成经济动荡。
但长远来看,这一模式还是利大于弊。因为市场资源是恒定的,当传统产业完成向新兴产业的转化时,就不会再有上述问题。再者就是缺乏监管。每种新事物的出现可能会触及法律盲区。在缺乏有效监管的环境下不可避免的会出现诸多混乱。而且在相关法律出台之前,这一境况不会有太大改变。还有交易方面的隐患。在传统交易模式中,交易双方基本是面对面的,但网络商城隐藏了个人属性,使双方面对虚假诈骗信息的风险增加,也会使信任度下降,这是不利于长远发展的。电子商务虽然在我国这片沃土上得到蓬勃发展,但很多体制尚未健全。而在国外则有了很长一段时间的积淀,我们应该积极汲取经验,争取打造一个良好的环境。
第二章 技术背景
2.1 HTML5协议
自1999年12月发布的HTML4.01后,对HTML(超文本标记语)做出的第5次重大修改。而较小的改动进行了多达近百项。其中有HTML和XHTML的标签的改动,相关的API等。新加入了对JavaScript和CSS3的诸多特性。HTML5取代了1999年制定的HTML 4.01、XHTML 1.0标准,让整个网页功能更加丰富。目前HTML5已被诸多主流浏览器支持。带给人们更丰富的网页体验。
2.2 SpringMVC 技术简介
Spring Web MVC是一种基于Java的实现了Web MVC设计模式轻量级框架,即使用了MVC架构模式的思想,对web层进行解耦,同时简化开发过程。优化代码冗余。在Web应用程序领域,MVC是一种著名的设计模式,基于请求驱动指的就是使用请求-响应模型。引入控制器的概念,在模型和视图之间引入重定向层以解决问题。SrpingMVC的工作原理如下:1.控制器将接收请求,执行更新模型的操作。2.之后更改模型更改的消息,并转发给视图。3视图的显示取决于依赖于模型的状态和依赖于请求的控制器。
Spring Mvc的强大之处在于:1.Spring MVC 实现了控制反转,为控制器提供相关功能。并且模块间高度解耦通过修改配置文件实现灵活更改组件。2.DispatcherServlet是SpringMVC 的重要组件。可以给处理程序分派请求,处理语言环境和执行视图解析。提供支持上传文件的功能。3.DispatcherServlet可以通过使用处理程序映射来决定哪一个处理程序应当处理传入的请求。即通过URL模式的映射。
图2.1 SpringMVC原理图
2.3 JSP技术简介
JSP是sun公司定义的一种用于开发动态web资源的技术。该技术的最大特点在于:写JSP就像写html,但它可以在html中嵌套java代码,为用户提供动态数据。在服务处理JSP页面是,通常将其视为一个Servlet。翻译过后的Servlet可以在 omcat主目录workCatalinalocalhost工程名orgapachejsp目录下查看,这是服务器的工作目录。打开相应的Servlet可以看到,翻译过后的servlet继承了org.apache.jasper.runtime.HttpJspBase。从而得出一个结论:JSP和Servlet基本上是等价的。
2.4 数据库技术
在上世纪60是年代初数据库技术开始发展。当时为了解决纸质文件体统不易保存和管理,而致力于研究一个可以有效地管理和存取大量的数据资源的系统。数据库技术则应运而生,其技战核心是使用和管理数据。近年来,数据库技术和计算机网络技术的发展相辅相成。,是当今计算机领域应用最广泛的两大领域.数据库技术不仅应用于事务处理,并且进一步应用到情报检索,人工智能,专家系统,计算机辅助设计等领域。本次设计用到的是MySQL。
本次设计用到的是由瑞典MySQL AB 公司开发的一个关系型数据库管理系统,目前属于 Oracle 旗下产品。MySQL 是最流行的关系型数据库管理系统之一,在 WEB 应用方面,MySQL是最好的应用软件。
2.5 Tomcat服务器
Tomcat服务器是由一个非营利性组织研发的免费开源的web应用服务器。参与开发的成员大多是业内资深程序员,另外一些公司如Sun、Apache等都曾参与过开发。同时也是Apache软件基金会(Apache Software Foundation)的Jakarta项目中的一个核心项目。得益于Sun公司的支持,在Tomcat中Servlet和Jsp的新特性得以体现。比如Tomcat v5.0支持最新的规范(Servlet 2.4和JSP 2.0)。Tomcat开源性使得其有着优秀的拓展性。一些优秀的想法得以体现。深受java开发者的喜爱。对于初学者而言,它也是一个容易上手的服务器。在并发量不是很高的中小型企业之中,是比较流行轻量级web应用服务器。是很多开发者的首选。
第三章 需求分析
3.1可行性分析
剩余内容已隐藏,请支付后下载全文,论文总字数:37249字
该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;