All Projects → July077 → Shoppingmall

July077 / Shoppingmall

使用主流框架组合SSM开发,并引入新技术,全面丰富的一个商城项目

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Shoppingmall

Seckill
基于SpringMVC,Spring,MyBatis实现的秒杀系统(参见慕课网,做了些改动)
Stars: ✭ 93 (+34.78%)
Mutual labels:  redis, ssm, maven
Seckill
一个整合SSM框架的高并发和商品秒杀项目,学习目前较流行的Java框架组合实现高并发秒杀API
Stars: ✭ 513 (+643.48%)
Mutual labels:  shop, redis, ssm
Ssm booksystem
ssm demo,ssm详细教程,SSM简明教程:简单的十步教你搭建人生第一个SSM框架[ SSM框架整合教程(spring+spring mvc+mybatis+redis+maven+idea+bootstrap) ]
Stars: ✭ 355 (+414.49%)
Mutual labels:  redis, ssm, maven
Taotao Store
淘淘网上商城是一个综合性的B2C平台,类似京东商城、天猫商城。会员可以在商城浏览商品、下订单,以及参加各种活动。商家可以在入住淘淘商城,在该平台上开店出售自己的商品,并且得到淘淘商城提供的可靠的服务。管理员、运营可以在平台后台管理系统中管理商品、订单、会员等。客服可以在后台管理系统中处理用户的询问以及投诉。
Stars: ✭ 114 (+65.22%)
Mutual labels:  redis, ssm, maven
Hahu
参照知乎网做的一个简易版问答网站,后台采用Java语言,及Spring,SpringMVC,MyBatis等框架,模版引擎使用FreeMarker。数据库用到MySQL,Redis。
Stars: ✭ 408 (+491.3%)
Mutual labels:  redis, ssm, maven
Ssm Demo
🍌Spring+SpringMVC+Mybatis+easyUI实现简单的后台管理系统
Stars: ✭ 1,639 (+2275.36%)
Mutual labels:  redis, ssm, maven
Ssm
💕 build SSM from 0 👉🏽👉🏽 distributed micro service.
Stars: ✭ 3,383 (+4802.9%)
Mutual labels:  redis, ssm
Superboot
随着技术日新月异,新技术新平台不断出现,对现如今的开发人员来说选择快速高效的框架进行项目开发,既能提高产出,又能节约时间。本框架无需开发即可实现服务注册、服务发现、负载均衡、服务网关、配置中心、API管理、分布式事务、支撑平台、集成框架、数据传输加密等功能,是学习SpringCloud整体业务模式的完整示例,并且可以直接用于生产环境
Stars: ✭ 341 (+394.2%)
Mutual labels:  redis, javaee
Highdsa
2018年本科毕设项目,已更新所有开发和部署文档。基于Dubbo、SSM、Shiro、ELK、ActiveMQ、Redis等实现的一套高可用、高性能、高可扩展的分布式系统架构,实现可支持业务的基础公共服务,API使用Restful风格对外暴露。已经实现的包括:发送邮件服务、FastDFS文件存储服务、ELK实时日志查询服务、Redis缓存服务、Mybatis数据库、阿里短信推送、Goeasy消息推送、Druid监控、ActiveMQ消息队列、shiro权限认证、cas单点登录、权限配置web系统、移动端后台系统。持续更新中......
Stars: ✭ 385 (+457.97%)
Mutual labels:  redis, maven
gobang04
五子棋社区,前后端完全分离,SSM框架,CORS跨域访问,SSO单点登录,Bootstrap界面,RESTful构架风格,Netty即时通信,Token口令授权,Web端与客户端通信。异步请求,面向接口编程。
Stars: ✭ 14 (-79.71%)
Mutual labels:  javaee, ssm
Forum
一个简单的论坛项目,开发IDE为IntelliJ IDEA,通过Maven构建,后台采用Spring、SpringMVC、MyBatis,数据库采用MySQL、Redis,前台用到jQuery,图片被上传到七牛云。
Stars: ✭ 407 (+489.86%)
Mutual labels:  redis, ssm
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (+520.29%)
Mutual labels:  redis, maven
Hope Boot
🌱 Hope-Boot 一款现代化的脚手架项目
Stars: ✭ 3,241 (+4597.1%)
Mutual labels:  redis, maven
WebChat
一份关于webSocket网页聊天的小demo
Stars: ✭ 54 (-21.74%)
Mutual labels:  maven, ssm
E3Mall
高并发,分布式Java项目,模拟天猫商城,京东商城
Stars: ✭ 33 (-52.17%)
Mutual labels:  maven, ssm
Ssm
J2EE项目系列(四)–SSM框架构建积分系统和基本商品检索系统(Spring+SpringMVC+MyBatis+Lucene+Redis+MAVEN)
Stars: ✭ 914 (+1224.64%)
Mutual labels:  redis, ssm
Xmall
基于SOA架构的分布式电商购物商城 前后端分离 前台商城:Vue全家桶 后台管理系统:Dubbo/SSM/Elasticsearch/Redis/MySQL/ActiveMQ/Shiro/Zookeeper等
Stars: ✭ 6,493 (+9310.14%)
Mutual labels:  redis, ssm
Online Bookstore
📓网上书店,SSM 架构练手项目。Shiro 做权限管理,Redis 做书籍缓存,ActiveMQ 做异步交易,Lucene 做全文搜索
Stars: ✭ 23 (-66.67%)
Mutual labels:  redis, ssm
Ssm redis template
An template based on Maven, using Spring + Spring MVC + mybatis + spring-data-redis frames. It can be used to construct a new Java Web Appliaction quickly
Stars: ✭ 13 (-81.16%)
Mutual labels:  redis, maven
library-booksystem
基于ssm的入门项目,图书在线管理系统。a library system.
Stars: ✭ 26 (-62.32%)
Mutual labels:  maven, ssm

shoppingMall

使用主流框架组合SSM开发,并引入新技术,全面丰富的一个商城项目,美其名曰"京东商城"

项目起源

这个项目全名叫"淘淘商城",是大陆某培训机构压轴的一个项目.项目是几年前就已经出来了,每一届的项目都在改进.做这个项目的原因是项目里融汇了许多的知识点,做一遍下来可以开阔下自己的眼界.不得不说,在网上论坛里面大量地黑培训机构可能是太片面了点,把项目的整个流程做下来的话,最起码能了解很大一部分项目中涉及的技术点,当然也要看个人了,反观我们大陆大部分普通高校毕业学生出来在项目经验上确实没办法相比,当然仅仅只能说是项目编码经验上.反正我个人认为还是取决于自己吧!

整个项目的弊端也很容易看出来:

  • 教学时间太短暂,带来的就是思考的时间不是很多
  • 前端页面是直接提供的,你只能粘贴复制,完全不用考虑页面出现的各种问题
  • 很多知识点一带而过,不讲技术原理,直接给出解决办法

利益都是相对的,优点也是很明显:

  • 对于很多想找工作的人来说培训出来很快找到份工作
  • 对于大多数普通高校毕业生培训接触到的知识点是在学校无法接触到的
  • 项目经验不同于书本上的项目讲解,知识点比较新颖,碰到问题可以寻求帮助
  • 跟一群能大部分志同道合的人一起学习氛围会更加好

项目环境

  • 操作系统 : Ubuntu 17.04 (视频开发采用Windows7,部署项目使用Centos虚拟机)
  • IDE :IntelliJ IDEA 2017.1.1 x64 (视频是用Eclipse,如果用IDEA的话有些坑你是肯定会碰见的)
  • JDK : JDK1.7 (一开始使用1.8搭建,后来跟dubbo出现了冲突智能换回1.7)
  • Web容器 : Tomcat (视频里面使用Maven Tomcat插件)
  • 数据库 :Mysql-5.7.17-winx64
  • 依赖管理工具 : Maven 整个项目非常依赖Maven
  • 版本控制工具 : Git (视频里面使用SVN,我这里使用的是Git)

项目概述

  • 项目最终Maven模块数量为26个,不区分父子模块
    note/images/mavenCount.png
  • 项目最终部署Tomcat情况,前半部分为部署项目名,后面数字为端口号
    note/images/tomcatInfo.png
  • IDEA中项目图
    note/images/ideaProject.png
  • 系统构架图(项目给出的图)
    note/images/taotao.png

开发流程

要么你就跟着视频一步一步走下去,每天都有教学笔记的,如果你是想过一遍技术点的话,完全可以根据每天的文档跟源代码自己练习下去,文档真的很详细,分为PDFDoc两种版本,简直就是一步步地教你开发

项目中碰到的一些问题的总结

① java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8083-exec-1" 内存溢出

java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8083-exec-1"

看到这个错误大概就知道是跟内存有点关系了,直接去Tomcat里面添加运行参数吧,下面是我在IDEA里面的做法

  • MAVEN tomcat插件 mavenTomcat.png
  • IDEA配置的Tomcat容器 mavenTomcat.png
    参数: -server -XX:PermSize=256M -XX:MaxPermSize=512m 参数是根据你自己需求去改的,在你内存不是很紧张的情况下,尽量分配高一点的内存,减少JVM频繁GC次数,这里只是设置了几个基本的参数,参数的意义就是
    • -server是一个要为第一个参数的
    • -XX:PermSize=256M 持久区初始化的内存大小
    • -XX:MaxPermSize=512m 持久去最大的内存大小

② SpringMvc文件上传失败问题

在进行文件上传的时候出现一个这样的问题
SpringMvcFileUPloadError
仔细一看,我猜测是Spring文件上传的配置没有配置,然后去applicationContext-Mvc.xml中看了下我的配置文件

 <bean id="commonsMultipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <!--设置默认的编码-->
        <property name="defaultEncoding" value="UTF-8"/>
        <!--设置文件上传的最大值-->
        <property name="maxUploadSize" value="5242880"/>
    </bean>

我感觉也没有配错,然后查了下资料,发现bean的名字错了,改为

 <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <!--设置默认的编码-->
        <property name="defaultEncoding" value="UTF-8"/>
        <!--设置文件上传的最大值-->
        <property name="maxUploadSize" value="5242880"/>
    </bean>

原理DispatcherServlet DispatcherServlet 这里把bean的名字固定了的

③ 搭建redis集群的时候无法安装Ruby搭建集群脚本

执行gem install redis-3.0.0.gem是报错的,找不到这个东西

ERROR:  Could not find a valid gem 'redis-3.0.0.gem' (>= 0) in any repository

然后Google找到了官网的脚本

gem install redis -v 3.0.0

 ④ 操作redis集群出现异常

部分异常出错代码:

redis.clients.jedis.exceptions.JedisMovedDataException: MOVED 11149 127.0.0.1:7001

	at redis.clients.jedis.Protocol.processError(Protocol.java:108)
	at redis.clients.jedis.Protocol.process(Protocol.java:142)
	at redis.clients.jedis.Protocol.read(Protocol.java:196)
	at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:288)
	at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:187)

这个错误的原因就是跟redis集群有关系,redis把这个key分配到了127.0.0.1:7001节点上去了,然后并没有找到这个节点,所以报错了.查看applicationContext-redis.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
    <!--单机版跟集群版只能选其中一个-->
    <!-- 1.配置单机版的连接 -->
     <bean id="jedisPool" class="redis.clients.jedis.JedisPool">
         <constructor-arg name="host" value="127.0.0.1"/>
         <constructor-arg name="port" value="6379"/>
     </bean>
     <bean id="jedisClientPool" class="JedisClientPool"/>

    <!-- 2.集群版的配置 -->
    <!-- <bean id="jedisCluster" class="redis.clients.jedis.JedisCluster">
        <constructor-arg>
            <set>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="6379"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7000"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7001"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7002"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7003"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7004"/>
                </bean>
            </set>
        </constructor-arg>
    </bean>
    <bean id="jedisClientCluster" class="JedisClientCluster"/>    -->
 </beans>

可以发现这里其实是配置一个单机版集群版的两个配置,然后这里是使用了单机版的,所以的话集群是使用不了的,然后就会出现这个错误了,把单机版的配置注释掉,再把集群版取消注释就可以了,如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
     <!--单机版跟集群版只能选其中一个-->
    <!-- 1.配置单机版的连接 -->
    <!--    <bean id="jedisPool" class="redis.clients.jedis.JedisPool">
         <constructor-arg name="host" value="127.0.0.1"/>
         <constructor-arg name="port" value="6379"/>
     </bean>
     <bean id="jedisClientPool" class="JedisClientPool"/>    -->

    <!-- 2.集群版的配置 -->
     <bean id="jedisCluster" class="redis.clients.jedis.JedisCluster">
        <constructor-arg>
            <set>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="6379"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7000"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7001"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7002"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7003"/>
                </bean>
                <bean class="redis.clients.jedis.HostAndPort">
                    <constructor-arg name="host" value="127.0.0.1"/>
                    <constructor-arg name="port" value="7004"/>
                </bean>
            </set>
        </constructor-arg>
    </bean>
    <bean id="jedisClientCluster" class="JedisClientCluster"/>   
</beans>

⑤ 页面EL表达式无效问题

在搜索模块这个页面上,EL表达式一直是直接显示文字的,没有显示出解析出来的值,看到这个话根据以前的经验,根本就没有解析表达式,直接去查看web.xml,我这个文件是IDEA生成Maven webapp那个骨架自动生成的,有点坑呀

<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
       中间省略
</web-app>

果然看这个问题就出来,Sevlet2.4开始JSP页面有一个指令默认为false

<%@ page isELIgnored="false" %>

但是上一个版本Servlet2.0中有说法也是说默认为false的,在Oracle官网找了下找到具体的说明,找到了这篇文档https://docs.oracle.com/cd/E19316-01/819-3669/bnaic/index.html, 截取部分文档内容:

Deactivating Expression Evaluation
Because the patterns that identify EL expressions, ${ } and #{ }, were not reserved in the JSP specifications before JSP 2.0, there might exist applications in which such patterns are intended to pass through verbatim. To prevent the patterns from being evaluated, you can deactivate EL evaluation using one of the following methods:

Escape the #{ or ${ characters in the page.

Configure the application with a JSP Property Group.

Configure the page with the page directive.

To escape the #{ or ${ characters in the page, you use the \ character as follows:

some text \#{ some more\${ text
<my:tag someAttribute="sometext\#{more\${text" />
Another way to deactivate EL evaluation is by using a JSP property group to either allow the #{ characters as a String literal using the deferred-syntax-allowed-as-literal subelement, or to treat all expressions as literals using the el-ignored subelement:

<jsp-property-group>
    <deferred-syntax-allowed-as-literal>
        true
    </deferred-syntax-allowed-as-literal>
</jsp-property-group>
or

<jsp-property-group>
    <el-ignored>true</el-ignored>
</jsp-property-group>
Finally, you can configure the page with the page directive to either accept the #{ characters as String literals with the deferredSyntaxAllowedAsLiteral attribute, or to ignore all EL expressions using the isELIgnored attribute:

<%@page ... deferredSyntaxAllowedAsLiteral="true" %>
or

<%@ page isELIgnored ="true" %>
The valid values of these attributes are true and false. If isELIgnored is true, EL expressions are ignored when they appear in static text or tag attributes. If it is false, EL expressions are evaluated by the container only if the attribute has rtexprvalue set to true or the expression is a deferred expression.

The default value of isELIgnored varies depending on the version of the web application deployment descriptor. The default mode for JSP pages delivered with a Servlet 2.4 descriptor is to evaluate EL expressions; this automatically provides the default that most applications want. The default mode for JSP pages delivered using a descriptor from Servlet 2.3 or before is to ignore EL expressions; this provides backward compatibility.

这里就是教你怎么禁用EL表达式,不过我是真的没有想到为什么要禁用它,这里就说到了一句话 Finally, you can configure the page with the page directive to ignore all EL expressions using the isELIgnored attribute
忽略的指令就是:

<%@ page isELIgnored ="true" %>

最后还有一句话就是出现这个问题的原因了: The default value of isELIgnored varies depending on the version of the web application deployment descriptor. The default mode for JSP pages delivered with a Servlet 2.4 descriptor is to evaluate EL expressions; this automatically provides the default that most applications want. The default mode for JSP pages delivered using a descriptor from Servlet 2.3 or before is to ignore EL expressions; this provides backward compatibility. 翻译过来的大意就是这个isELIgnored属性是要依赖 Web应用的版本的,默认在Servlet2.4开始就是false,也就是不忽略EL表达式,但是在Servlet2.3以前就是默认为true的,也就是默认为忽略EL表达式的,这就是我们想要的答案,解决方法罗列出两种:

  • 直接修改web.xml中的Servlet版本,让它默认就是支持EL表达式的
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                     http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
        version="3.0"
        metadata-complete="true">
</web-app>
  • JSP页面使用page指令指定这个值了
<%@ page isELIgnored ="true" %>

在这里我还找到另外一篇的文档,供参考http://www.roseindia.net/tutorial/jsp/isELIgnoredAttribute.html,这里需要注意ServletJsp的版本号不要相混淆了
防止和谐贴出部分文档:

Page Directive attribute - isELIgnored
This tutorial contains description of isELIgnored attribute of page Directive.

isELIgnored Attribute :

page directive provides isELIgnored attribute which is of boolean type. This attribute controls the JSP Expression Language. The cause to use Expression Language is to eliminate java, Code from the Jsp. The true value of this attribute indicates that any Expression Language is ignored. False value allow you to use the EL. 
For JSP 1.2 version the default value of isELIgnored is true but for JSP 2.0 version and above the default value is false.

Syntax :

<%@ page isELIgnored="false" %> <!-- default value for JSP 2.0 -->

<%@ page isELIgnored="true" %> <!-- default value for JSP 1.2 -->
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].