淘淘商城第二天

1   课程计划

商品列表的查询

1、框架整合springmvc+spring+mybatis

2、创建数据库

3、使用mybatis的逆向工程生成代码

4、商品列表功能实现

2   创建数据库

使用mysql数据库。

在互联网行业的项目中尽可能的减少表的管理查询。使用冗余解决表的关联问题。有利于分库分表。

商品表:

Sku:最小库存量单位。就是商品id。就是商品最细力度的划分。每个sku都唯一对应一款商品,商品的颜色、配置都已经唯一确定。

3   逆向工程

Mybatis的逆向工程。根据数据库表生成java代码。

注意:如果想再次生成代码,必须先将已经生成的代码删除,否则会在原文件中追加。

4   Ssm框架整合

4.1  整合的思路

4.1.1   Dao层

使用mybatis框架。创建SqlMapConfig.xml。

创建一个applicationContext-dao.xml

1、配置数据源

2、需要让spring容器管理SqlsessionFactory,单例存在。

3、把mapper的代理对象放到spring容器中。使用扫描包的方式加载mapper的代理对象。

4.1.2   Service层

1、事务管理

2、需要把service实现类对象放到spring容器中管理。

4.1.3   表现层

1、配置注解驱动

2、配置视图解析器

3、需要扫描controller

4.1.4   Web.xml

1、spring容器的配置

2、Springmvc前端控制器的配置

3、Post乱码过滤器

4.2  框架整合

需要把配置文件放到taotao-manager-web工程下。因为此工程为war工程,其他的工程只是一个jar包。

4.2.1   Mybatis整合

  1 <?xml version="1.0" encoding="UTF-8" ?>
  2
  3 <!DOCTYPE configuration
  4
  5          PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  6
  7          "http://mybatis.org/dtd/mybatis-3-config.dtd">
  8
  9 <configuration>
 10
 11
 12
 13 </configuration>
 14 

applicationContext-dao.xml

  1 <?xml version="1.0" encoding="UTF-8"?>
  2
  3 <beans xmlns="http://www.springframework.org/schema/beans"
  4
  5      xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
  6
  7      xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
  8
  9      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 10
 11      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
 12
 13      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
 14
 15      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
 16
 17      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
 18
 19
 20
 21      <!-- 数据库连接池 -->
 22
 23      <!-- 加载配置文件 -->
 24
 25      <context:property-placeholder location="classpath:resource/db.properties" />
 26
 27      <!-- 数据库连接池 -->
 28
 29      <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
 30
 31          destroy-method="close">
 32
 33          <property name="url" value="${jdbc.url}" />
 34
 35          <property name="username" value="${jdbc.username}" />
 36
 37          <property name="password" value="${jdbc.password}" />
 38
 39          <property name="driverClassName" value="${jdbc.driver}" />
 40
 41          <property name="maxActive" value="10" />
 42
 43          <property name="minIdle" value="5" />
 44
 45      </bean>
 46
 47      <!-- 配置sqlsessionFactory -->
 48
 49      <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
 50
 51          <property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml"></property>
 52
 53          <property name="dataSource" ref="dataSource"></property>
 54
 55      </bean>
 56
 57      <!-- 配置扫描包,加载mapper代理对象 -->
 58
 59      <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
 60
 61          <property name="basePackage" value="com.taotao.mapper"></property>
 62
 63      </bean>
 64
 65 </beans>
 66 

4.2.2   Service层

applicationContext-service.xml

  1 <?xml version="1.0" encoding="UTF-8"?>
  2
  3 <beans xmlns="http://www.springframework.org/schema/beans"
  4
  5      xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
  6
  7      xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
  8
  9      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 10
 11      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
 12
 13      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
 14
 15      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
 16
 17      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
 18
 19
 20
 21      <!-- 扫描包加载Service实现类 -->
 22
 23      <context:component-scan base-package="com.taotao.service"></context:component-scan>
 24
 25 </beans>
 26 

applicationContext-trans.xml

  1 <?xml version="1.0" encoding="UTF-8"?>
  2
  3 <beans xmlns="http://www.springframework.org/schema/beans"
  4
  5      xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
  6
  7      xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
  8
  9      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 10
 11      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
 12
 13      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
 14
 15      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
 16
 17      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
 18
 19
 20
 21      <!-- 事务管理器 -->
 22
 23      <bean id="transactionManager"
 24
 25          class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
 26
 27          <!-- 数据源 -->
 28
 29          <property name="dataSource" ref="dataSource" />
 30
 31      </bean>
 32
 33      <!-- 通知 -->
 34
 35      <tx:advice id="txAdvice" transaction-manager="transactionManager">
 36
 37          <tx:attributes>
 38
 39               <!-- 传播行为 -->
 40
 41               <tx:method name="save*" propagation="REQUIRED" />
 42
 43               <tx:method name="insert*" propagation="REQUIRED" />
 44
 45               <tx:method name="add*" propagation="REQUIRED" />
 46
 47               <tx:method name="create*" propagation="REQUIRED" />
 48
 49               <tx:method name="delete*" propagation="REQUIRED" />
 50
 51               <tx:method name="update*" propagation="REQUIRED" />
 52
 53               <tx:method name="find*" propagation="SUPPORTS" read-only="true" />
 54
 55               <tx:method name="select*" propagation="SUPPORTS" read-only="true" />
 56
 57               <tx:method name="get*" propagation="SUPPORTS" read-only="true" />
 58
 59          </tx:attributes>
 60
 61      </tx:advice>
 62
 63      <!-- 切面 -->
 64
 65      <aop:config>
 66
 67          <aop:advisor advice-ref="txAdvice"
 68
 69               pointcut="execution(* com.taotao.service.*.*(..))" />
 70
 71      </aop:config>
 72
 73 </beans>
 74 

4.2.3   表现层

  1 <?xml version="1.0" encoding="UTF-8"?>
  2
  3 <beans xmlns="http://www.springframework.org/schema/beans"
  4
  5      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
  6
  7      xmlns:context="http://www.springframework.org/schema/context"
  8
  9      xmlns:mvc="http://www.springframework.org/schema/mvc"
 10
 11      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 12
 13         http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
 14
 15         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
 16
 17
 18
 19      <context:component-scan base-package="com.taotao.controller" />
 20
 21      <mvc:annotation-driven />
 22
 23      <bean
 24
 25          class="org.springframework.web.servlet.view.InternalResourceViewResolver">
 26
 27          <property name="prefix" value="/WEB-INF/jsp/" />
 28
 29          <property name="suffix" value=".jsp" />
 30
 31      </bean>
 32
 33 </beans>
 34 

Web.xml

  1 <?xml version="1.0" encoding="UTF-8"?>
  2
  3 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4
  5      xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  6
  7      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  8
  9      id="taotao" version="2.5">
 10
 11      <display-name>taotao-manager</display-name>
 12
 13      <welcome-file-list>
 14
 15           <welcome-file>index.html</welcome-file>
 16
 17          <welcome-file>index.htm</welcome-file>
 18
 19          <welcome-file>index.jsp</welcome-file>
 20
 21          <welcome-file>default.html</welcome-file>
 22
 23          <welcome-file>default.htm</welcome-file>
 24
 25          <welcome-file>default.jsp</welcome-file>
 26
 27      </welcome-file-list>
 28
 29      <!-- 加载spring容器 -->
 30
 31      <context-param>
 32
 33          <param-name>contextConfigLocation</param-name>
 34
 35          <param-value>classpath:spring/applicationContext-*.xml</param-value>
 36
 37      </context-param>
 38
 39      <listener>
 40
 41          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 42
 43      </listener>
 44
 45      <!-- 解决post乱码 -->
 46
 47      <filter>
 48
 49          <filter-name>CharacterEncodingFilter</filter-name>
 50
 51          <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
 52
 53          <init-param>
 54
 55               <param-name>encoding</param-name>
 56
 57               <param-value>utf-8</param-value>
 58
 59          </init-param>
 60
 61      </filter>
 62
 63      <filter-mapping>
 64
 65          <filter-name>CharacterEncodingFilter</filter-name>
 66
 67          <url-pattern>/*</url-pattern>
 68
 69      </filter-mapping>
 70
 71      <!-- springmvc的前端控制器 -->
 72
 73      <servlet>
 74
 75          <servlet-name>taotao-manager</servlet-name>
 76
 77          <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
 78
 79          <!-- contextConfigLocation不是必须的, 如果不配置contextConfigLocation, springmvc的配置文件默认在:WEB-INF/servlet的name+"-servlet.xml" -->
 80
 81          <init-param>
 82
 83               <param-name>contextConfigLocation</param-name>
 84
 85               <param-value>classpath:spring/springmvc.xml</param-value>
 86
 87          </init-param>
 88
 89          <load-on-startup>1</load-on-startup>
 90
 91      </servlet>
 92
 93      <servlet-mapping>
 94
 95          <servlet-name>taotao-manager</servlet-name>
 96
 97          <url-pattern>/</url-pattern>
 98
 99      </servlet-mapping>
100
101 </web-app>
102 

/:会拦截所有请求包括静态资源。需要在springmvc.xml中添加静态资源的映射。

  1 <!-- 资源映射 -->
  2
  3      <mvc:resources location="/WEB-INF/css/" mapping="/css/**"/>
  4
  5      <mvc:resources location="/WEB-INF/js/" mapping="/js/**"/>
  6 

4.2.4   添加静态资源


5   Springmvc和spring的父子容器关系

在applicationContext-service中配置:

  1 <!-- 扫描包加载Service实现类 -->
  2
  3 <context:component-scan base-package="com.taotao"></context:component-scan>
  4
  5 会扫描@Controller、@Service、@Repository、@Compnent
  6
  7
  8 

Springmvc。Xml中不扫描。

结论:springmvc。不能提供服务,因为springmvc子容器中没有controller对象。

6   测试整合结果

6.1  需求

跟据商品id查询商品信息。

6.2  Sql语句

SELECT * from tb_item WHERE
id=536563

6.3  Dao层

可以使用逆向工程生成的mapper文件。

6.4  Service层

接收商品id调用dao查询商品信息。返回商品pojo对象。

  1 /**
  2
  3  * 商品管理Service
  4
  5  * <p>Title: ItemServiceImpl</p>
  6
  7  * <p>Description: </p>
  8
  9  * <p>Company: www.itcast.com</p>
 10
 11  * @author    入云龙
 12
 13  * @date  2015年9月2日上午10:47:14
 14
 15  * @version 1.0
 16
 17  */
 18
 19 @Service
 20
 21 public class ItemServiceImpl implements ItemService {
 22
 23
 24
 25      @Autowired
 26
 27      private TbItemMapper itemMapper;
 28
 29
 30
 31      @Override
 32
 33      public TbItem getItemById(long itemId) {
 34
 35
 36
 37          //TbItem item = itemMapper.selectByPrimaryKey(itemId);
 38
 39          //添加查询条件
 40
 41          TbItemExample example = new TbItemExample();
 42
 43          Criteria criteria = example.createCriteria();
 44
 45          criteria.andIdEqualTo(itemId);
 46
 47          List<TbItem> list = itemMapper.selectByExample(example);
 48
 49          if (list != null && list.size() > 0) {
 50
 51               TbItem item = list.get(0);
 52
 53               return item;
 54
 55          }
 56
 57          return null;
 58
 59      }
 60
 61
 62
 63 }
 64 

6.5  Controller层

接收页面请求商品id,调用service查询商品信息。直接返回一个json数据。需要使用@ResponseBody注解。

  1 @Controller
  2
  3 public class ItemController {
  4
  5
  6
  7      @Autowired
  8
  9      private ItemService itemService;
 10
 11
 12
 13      @RequestMapping("/item/{itemId}")
 14
 15      @ResponseBody
 16
 17      public TbItem getItemById(@PathVariable Long itemId) {
 18
 19          TbItem tbItem = itemService.getItemById(itemId);
 20
 21          return tbItem;
 22
 23      }
 24
 25 }
 26 

解决方法:

修改taotao-manager-mapper的pom文件

在pom文件中添加如下内容:

  1 <!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
  2
  3      <build>
  4
  5          <resources>
  6
  7             <resource>
  8
  9                 <directory>src/main/java</directory>
 10
 11                 <includes>
 12
 13                     <include>**/*.properties</include>
 14
 15                     <include>**/*.xml</include>
 16
 17                 </includes>
 18
 19                 <filtering>false</filtering>
 20
 21             </resource>
 22
 23         </resources>
 24
 25      </build>
 26 

测试OK:

7   使用maven的tomcat插件时debug

下次启动生效。

第二种方法:

8   商品列表的实现

8.1  打开后台管理工程的首页

分析:先写一个controller进行页面跳转展示首页。

首页是使用easyUI开发。

  1 /**
  2
  3  * 页面跳转controller
  4
  5  * <p>Title: PageController</p>
  6
  7  * <p>Description: </p>
  8
  9  * <p>Company: www.itcast.com</p>
 10
 11  * @author    入云龙
 12
 13  * @date  2015年9月2日上午11:11:41
 14
 15  * @version 1.0
 16
 17  */
 18
 19 @Controller
 20
 21 public class PageController {
 22
 23
 24
 25      /**
 26
 27       * 打开首页
 28
 29       */
 30
 31      @RequestMapping("/")
 32
 33      public String showIndex() {
 34
 35          return "index";
 36
 37      }
 38
 39      /**
 40
 41       * 展示其他页面
 42
 43       * <p>Title: showpage</p>
 44
 45       * <p>Description: </p>
 46
 47       * @param page
 48
 49       * @return
 50
 51       */
 52
 53      @RequestMapping("/{page}")
 54
 55      public String showpage(@PathVariable String page) {
 56
 57          return page;
 58
 59      }
 60
 61 }
 62
 63
 64 

8.2  商品列表查询

8.2.1   需求分析

1、请求的url:/item/list

2、请求的参数:http://localhost:8080/item/list?page=1&rows=30    分页信息。(需要看官方的手册)

3、返回值。Json数据。数据格式:

Easyui中datagrid控件要求的数据格式为:

  1 {total:”2”,rows:[{“id”:”1”,”name”,”张三”},{“id”:”2”,”name”,”李四”}]}

8.2.2   Dao层

Sql语句:SELECT * from tb_item LIMIT
0,30

8.2.2.1         分页插件PageHelper

8.2.2.1.1       官方网站:

https://github.com/pagehelper/Mybatis-PageHelper/tree/master/src/main/java/com/github/pagehelper


8.2.2.1.2       实现原理
8.2.2.1.3       使用方法

第一步:引入pageHelper的jar包。

第二步:需要在SqlMapConfig.xml中配置插件。

  1 <?xml version="1.0" encoding="UTF-8" ?>
  2
  3 <!DOCTYPE configuration
  4
  5          PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  6
  7          "http://mybatis.org/dtd/mybatis-3-config.dtd">
  8
  9 <configuration>
 10
 11      <!-- 配置分页插件 -->
 12
 13      <plugins>
 14
 15          <plugin interceptor="com.github.pagehelper.PageHelper">
 16
 17               <!-- 设置数据库类型Oracle,Mysql,MariaDB,SQLite,Hsqldb,PostgreSQL六种数据库-->
 18
 19            <property name="dialect" value="mysql"/>
 20
 21          </plugin>
 22
 23      </plugins>
 24
 25 </configuration>
 26 

第三步:在查询的sql语句执行之前,添加一行代码:

PageHelper.startPage(1,
10);

第一个参数是page,要显示第几页。

第二个参数是rows,没页显示的记录数。

第四步:取查询结果的总数量。

创建一个PageInfo类的对象,从对象中取分页信息。

8.2.2.1.4       分页测试

  1 public class TestPageHelper {
  2
  3
  4
  5      @Test
  6
  7      public void testPageHelper() {
  8
  9          //创建一个spring容器
 10
 11          ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:spring/applicationContext-*.xml");
 12
 13          //从spring容器中获得Mapper的代理对象
 14
 15          TbItemMapper mapper = applicationContext.getBean(TbItemMapper.class);
 16
 17          //执行查询,并分页
 18
 19          TbItemExample example = new TbItemExample();
 20
 21          //分页处理
 22
 23          PageHelper.startPage(2, 10);
 24
 25          List<TbItem> list = mapper.selectByExample(example);
 26
 27          //取商品列表
 28
 29          for (TbItem tbItem : list) {
 30
 31               System.out.println(tbItem.getTitle());
 32
 33          }
 34
 35          //取分页信息
 36
 37          PageInfo<TbItem> pageInfo = new PageInfo<>(list);
 38
 39          long total = pageInfo.getTotal();
 40
 41          System.out.println("共有商品:"+ total);
 42
 43
 44
 45      }
 46
 47 }
 48 

注意:分页插件对逆向工程生成的代码支持不好,不能对有查询条件的查询分页。会抛异常。

使用我修改过的版本就可以了。

Dao可以实现逆向工程生成的mapper文件+PageHelper实现。

8.2.3   Service层

接收分页参数,一个是page一个是rows。调用dao查询商品列表。并分页。返回商品列表。

返回一个EasyUIDateGrid支持的数据格式。需要创建一个Pojo。此pojo应该放到taotao-common工程中。

  1 public class EUDataGridResult {
  2
  3
  4
  5      private long total;
  6
  7      private List<?> rows;
  8
  9      public long getTotal() {
 10
 11          return total;
 12
 13      }
 14
 15      public void setTotal(long total) {
 16
 17          this.total = total;
 18
 19      }
 20
 21      public List<?> getRows() {
 22
 23          return rows;
 24
 25      }
 26
 27      public void setRows(List<?> rows) {
 28
 29          this.rows = rows;
 30
 31      }
 32
 33
 34
 35
 36
 37 }
 38 

代码实现

  1 /**
  2
  3       * 商品列表查询
  4
  5       * <p>Title: getItemList</p>
  6
  7       * <p>Description: </p>
  8
  9       * @param page
 10
 11       * @param rows
 12
 13       * @return
 14
 15       * @see com.taotao.service.ItemService#getItemList(long, long)
 16
 17       */
 18
 19      @Override
 20
 21      public EUDataGridResult getItemList(int page, int rows) {
 22
 23          //查询商品列表
 24
 25          TbItemExample example = new TbItemExample();
 26
 27          //分页处理
 28
 29          PageHelper.startPage(page, rows);
 30
 31          List<TbItem> list = itemMapper.selectByExample(example);
 32
 33          //创建一个返回值对象
 34
 35          EUDataGridResult result = new EUDataGridResult();
 36
 37          result.setRows(list);
 38
 39          //取记录总条数
 40
 41          PageInfo<TbItem> pageInfo = new PageInfo<>(list);
 42
 43          result.setTotal(pageInfo.getTotal());
 44
 45          return result;
 46
 47      }
 48 

8.2.4   Controller

接收页面传递过来的参数page、rows。返回json格式的数据。EUDataGridResult

需要使用到@ResponseBody注解。

  1 @RequestMapping("/item/list")
  2
  3      @ResponseBody
  4
  5      public EUDataGridResult getItemList(Integer page, Integer rows) {
  6
  7          EUDataGridResult result = itemService.getItemList(page, rows);
  8
  9          return result;
 10
 11      }
 12 

截图留念:

时间: 2024-08-29 03:49:36

淘淘商城第二天的相关文章

(转) 淘淘商城系列——Redis的安装

http://blog.csdn.net/yerenyuan_pku/article/details/72849612 通过上文的学习,我相信大家已经将首页的轮播图展示出来了,接下来我们将进入一个新的领域的学习,希望大家能振作精神,保持乐观向上的心态.本文我会教大家如何在Linux系统上安装Redis. 一般来说,如果我们是做一个互联网项目,通常都要在工程中添加缓存,之所以这样做,是因为在互联网项目中查询功能是非常频繁的,如果每次查询都调用数据库的话,会给数据库造成很大的压力,因此需要在用户和数

(转)淘淘商城系列——实现图片上传功能

http://blog.csdn.net/yerenyuan_pku/article/details/72808000 上文我们使用FastDFS-Client进行了简单的文件上传操作测试,淘淘商城项目中添加商品时上传图片的功能还没实现,如下图所示.本文将花大量笔墨来教大家如何实现图片上传这个功能. 我们来看下item-add.jsp页面,可以看到上传图片触发的方法是通过叫做picFileUpload的class来处理的,在<a>标签的下方是一个隐藏域,是用来接收图片上传到图片服务器的回显地址

(转) 淘淘商城系列——使用FastDFS-Client客户端进行上传图片的测试

http://blog.csdn.net/yerenyuan_pku/article/details/72804018 不久之前,我们实现了商品的类目选择这个功能,但这只是万里长征的第一步,我们还有很多事情需要做,例如怎样实现图片上传这个功能.本文就来教大家如何实现图片上传. 图片上传分析 我们知道,对于传统项目来说,所有的模块都在一个项目中开发,包括所有静态资源文件比如图片等,都存储在这一个tomcat服务器上,如下图所示. 如果访问量小的话,这样做问题倒不大,但是对于互联网项目来说,用户访问

淘淘商城_0100_前言

好记性不如烂笔头,寄点东西吧!大神请略过此系列文章,,, 淘淘商城是传智播客发布的视频教程,里头涉及的技术点挺多的,之前看过一部分,感觉不错,但是过段时间又忘了, 智商一直是我的硬伤,还是寄点东西吧! 为了完整性,把一些文档也贴出来吧!虽然用处不大.. 1   课程计划 一共14天课程 1.第一天:电商行业的背景.淘淘商城的介绍.搭建项目工程.Svn的使用. 2.第二天:框架的整合.后台管理商品列表的实现.分页插件. 3.第三天:后台管理.商品添加.商品类目的选择.图片上传.富文本编辑器的使用.

淘淘商城的第一天

学习视频下载路劲:链接:http://pan.baidu.com/s/1dFF4KiX 密码:q6f0 1 课程计划 一共14天课程 1.第一天:电商行业的背景.淘淘商城的介绍.搭建项目工程.Svn的使用. 2.第二天:框架的整合.后台管理商品列表的实现.分页插件. 3.第三天:后台管理.商品添加.商品类目的选择.图片上传.富文本编辑器的使用. 4.第四天:商品规格的实现. 5.第五天:商城前台系统的搭建.首页商品分类的展示.Jsonp. 6.第六天:cms系统的实现.前台大广告位的展示. 7.

淘淘商城第一天——项目介绍与项目搭建

一.项目目录概述 一共14天课程 1.第一天:电商行业的背景.淘淘商城的介绍.搭建项目工程.Svn的使用. 2.第二天:框架的整合.后台管理商品列表的实现.分页插件. 3.第三天:后台管理.商品添加.商品类目的选择.图片上传.富文本编辑器的使用. 4.第四天:商品规格的实现. 5.第五天:商城前台系统的搭建.首页商品分类的展示.Jsonp. 6.第六天:cms系统的实现.前台大广告位的展示. 7.第七天:cms系统添加缓存.Redis.缓存同步. 8.第八天:搜索功能的实现.使用solr实现搜索

第04项目:淘淘商城(SpringMVC+Spring+Mybatis)【第十天】(单点登录系统实现)

https://pan.baidu.com/s/1bptYGAb#list/path=%2F&parentPath=%2Fsharelink389619878-229862621083040 第04项目:淘淘商城(SpringMVC+Spring+Mybatis) 的学习实践总结[第六天] 第04项目:淘淘商城(SpringMVC+Spring+Mybatis)[第七天](redis缓存) 第04项目:淘淘商城(SpringMVC+Spring+Mybatis)[第八天](solr服务器搭建.搜

(转)淘淘商城系列——商品搜索功能测试

http://blog.csdn.net/yerenyuan_pku/article/details/72941506 到这里,我相信大家也是不容易,我自己也算是很不容易写到这里,希望自己能一直写下去.之前我们就差不多把商品搜索功能实现了,本文我们来一起测试下该搜索功能. 首先我们要保证zookeeper.redis.image.solr服务都开启.接着我们把taotao-common工程重新打包到本地maven仓库,由于taotao-search-interface工程新添加了一个接口,所以我

01淘淘商城项目:项目Maven工程搭建

最近在学习淘淘商城项目的搭建,使用maven做管理 后台管理系统工程搭建: 使用maven的好处: 1.依赖管理.jar包.工程之间依赖 2.项目构建:实现项目的一步构建 3.工程聚合.继承.依赖 maven工程分为三种类型: pom工程:用在父级工程,聚合工程中 war包工程:主要用作网站 jar包工程:就是当作jar使用的,可以用来打包 先给出总的项目结构,然后再解释是如何实现这些结构的 解释如下: 1.taotao-parent taotao-parent公司级别的maven工程.主要功能

淘淘商城系列——使用maven构建工程

开发工具和环境 这里,我统一规范一下淘淘商城的开发工具和环境,如下: Eclipse 4.5.2(Mars2),其自带maven插件,需要手工安装svn插件,但我提供的这个eclipse,svn插件已经搭好了 Maven-3.3.9(开发工具自带) Tomcat-7.0.75(Maven Tomcat Plugin) JDK 1.7 MySQL 5.7.17 Nginx 1.8.0 Redis 3.0.0 Win10 操作系统 SVN(版本管理工具) 工程搭建 使用maven的好处 项目构建.M