項目整體思路出來古沥,打算糅合自己項目學過的東西瘸右,做一個整體的基本demo出來,與這個項目相關的博客會不斷寫出來給大家的岩齿,盡請期待太颤。
文章結構:(1)SSM框架整合以及測試;(2)Redis單機版以及測試盹沈。
(Lucene在接下來的篇章再寫出來)
一龄章、SSM框架整合以及測試:(IntelliJ IDEA開發(fā))
先說下我的一慣思路:Spring->dao(Mybatis、hibernate)->SpringMVC乞封。每一步的整合都要做一個測試類測試W鋈埂!肃晚!
(1)maven對應資源:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.fuzhu</groupId>
<artifactId>SSM</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>SSM Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mysql.version>5.1.37</mysql.version>
<spring.version>4.1.7.RELEASE</spring.version>
</properties>
<dependencies>
<!-- 單元測試 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<!-- 1.日志 -->
<!-- 實現slf4j接口并整合 -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.1</version>
</dependency>
<!-- 2.數據庫 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
<scope>runtime</scope>
</dependency>
<!-- 阿里的druid dataSource -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.0</version>
</dependency>
<!-- DAO: MyBatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.3</version>
</dependency>
<!-- 3.Servlet web -->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.4</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<!-- 4.Spring -->
<!-- 1)Spring核心 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- 2)Spring DAO層 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- 3)Spring web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- 4)Spring test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- redis客戶端:Jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.7.3</version>
</dependency>
<!-- Map工具類 -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
<!--fastjson-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.5</version>
</dependency>
</dependencies>
<build>
<finalName>SSM</finalName>
</build>
</project>
(2)編寫spring的配置:
1.讀入數據庫連接相關參數锚贱;2.數據庫連接池druid;3.配置連接屬性陷揪;4.配置SqlSessionFactory對象(mybatis)惋鸥;5.掃描dao層接口杂穷,動態(tài)實現dao接口悍缠,也就是說不需要daoImpl,sql和參數都寫在xml文件上耐量。
mysql_driverClassName=com.mysql.jdbc.Driver
mysql_url=jdbc:mysql://localhost:3306/ssm
mysql_username=root
mysql_password=
#我就把我這里的數據庫密碼給刪了吧飞蚓,大家自己以后上傳給別人的時候也記得刪喔,不然有點危險呢廊蜒!
#另外趴拧,配置文件中的mysql_username,如果寫成username山叮,可能會與系統(tǒng)環(huán)境中的username變量沖突著榴,所以到時候真正連接數據庫的時候,用戶名就被替換成系統(tǒng)中的用戶名(有得可能是administrator)屁倔,那肯定是連接不成功的脑又。
druid_initialSize=1
druid_minIdle=1
druid_maxActive=10
druid_maxWait=10000
druid_timeBetweenEvictionRunsMillis=60000
druid_minEvictableIdleTimeMillis=300000
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- 配置整合mybatis過程 -->
<!-- 1.配置數據庫相關參數properties的屬性:${url} -->
<context:property-placeholder location="classpath:jdbc.properties" />
<!-- 2.數據庫連接池 -->
<!-- 配置數據源,記得去掉myBatis-config.xml的數據源相關配置 -->
<!-- 這里是在原始的基礎上添加了druid數據庫連接池,來監(jiān)控问麸。 -->
<!-- 注意 :driverClassName,url,username,password 這幾個值是固定的往衷,由bean class決定的 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="driverClassName" value="${mysql_driverClassName}" />
<property name="url" value="${mysql_url}" />
<property name="username" value="${mysql_username}" />
<property name="password" value="${mysql_password}" />
<!-- 配置初始化大小、最小严卖、最大 -->
<property name="initialSize" value="${druid_initialSize}" />
<property name="minIdle" value="${druid_minIdle}" />
<property name="maxActive" value="${druid_maxActive}" />
<!-- 配置獲取連接等待超時的時間 -->
<property name="maxWait" value="${druid_maxWait}" />
<!-- 配置間隔多久才進行一次檢測席舍,檢測需要關閉的空閑連接,單位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="${druid_timeBetweenEvictionRunsMillis}" />
<!-- 配置一個連接在池中最小生存的時間哮笆,單位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="${druid_minEvictableIdleTimeMillis}" />
<property name="testWhileIdle" value="true" />
<!-- 這里建議配置為TRUE来颤,防止取到的連接不可用 -->
<property name="testOnBorrow" value="true" />
<property name="testOnReturn" value="false" />
<!-- 打開PSCache,并且指定每個連接上PSCache的大小 -->
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize"
value="20" />
<property name="removeAbandoned" value="true" />
<property name="removeAbandonedTimeout" value="1800" />
<!-- 配置監(jiān)控統(tǒng)計攔截的filters疟呐,去掉后監(jiān)控界面sql無法統(tǒng)計 -->
<property name="filters" value="stat" />
</bean>
<!-- 3.配置SqlSessionFactory對象 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 注入數據庫連接池 -->
<property name="dataSource" ref="dataSource" />
<!-- 配置MyBaties全局配置文件:mybatis-config.xml -->
<property name="configLocation" value="classpath:mybatis/mybatis-config.xml" />
<!-- 掃描entity包 使用別名 -->
<property name="typeAliasesPackage" value="com.fuzhu.entity" />
<!-- 掃描sql配置文件:mapper需要的xml文件 -->
<property name="mapperLocations" value="classpath:com/fuzhu/mapper/*.xml" />
</bean>
<!-- 4.配置掃描Dao接口包脚曾,動態(tài)實現Dao接口,注入到spring容器中 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 注入sqlSessionFactory -->
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
<!-- 給出需要掃描Dao接口包 -->
<property name="basePackage" value="com.fuzhu.dao" />
</bean>
</beans>
(3)順便要編寫好mybatis配置喔
1.使用自增主鍵启具;2.使用列別名本讥;3.開啟駝峰命名轉換 create_time -> createTime
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 配置全局屬性 -->
<settings>
<!-- 使用jdbc的getGeneratedKeys獲取數據庫自增主鍵值 -->
<setting name="useGeneratedKeys" value="true" />
<!-- 使用列別名替換列名 默認:true -->
<setting name="useColumnLabel" value="true" />
<!-- 開啟駝峰命名轉換:Table{create_time} -> Entity{createTime} -->
<setting name="mapUnderscoreToCamelCase" value="true" />
</settings>
</configuration>
(4)寫好dao層配置就到service層配置了。
1.掃描service包所有注解 @Service鲁冯;2.配置事務管理器拷沸,把事務管理交由spring來完成;3.配置基于注解的聲明式事務薯演,可以直接在方法上@Transaction
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- 掃描service包下所有使用注解的類型 -->
<context:component-scan base-package="com.fuzhu.service" />
<!-- 配置事務管理器 -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!-- 注入數據庫連接池 -->
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 配置基于注解的聲明式事務 -->
<tx:annotation-driven transaction-manager="transactionManager" />
</beans>
(5)接著就編寫springmvc的配置了
1.開啟SpringMVC注解模式撞芍,可以使用@RequestMapping,@PathVariable跨扮,@ResponseBody等序无;
2.對靜態(tài)資源處理,如js衡创,css帝嗡,jpg等;
3.配置jsp 顯示ViewResolver璃氢,例如在controller中某個方法返回一個string類型的"login"哟玷,實際上會返回"/WEB-INF/login.jsp";
4.掃描web層 @Controller
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- 配置SpringMVC -->
<!-- 1.開啟SpringMVC注解模式 -->
<!-- 簡化配置:
(1)自動注冊DefaultAnootationHandlerMapping,AnotationMethodHandlerAdapter
(2)提供一些列:數據綁定一也,數字和日期的format @NumberFormat, @DateTimeFormat, xml,json默認讀寫支持
-->
<mvc:annotation-driven />
<!-- 2.靜態(tài)資源默認servlet配置
(1)加入對靜態(tài)資源的處理:js,gif,png
(2)允許使用"/"做整體映射
-->
<mvc:default-servlet-handler/>
<!-- 3.配置jsp 顯示ViewResolver -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<!-- 4.掃描web相關的bean -->
<context:component-scan base-package="com.fuzhu.controller" />
</beans>
注意:使用IDEA開發(fā)巢寡,我們是要給工程配置下spring環(huán)境的!椰苟!
(6)修改web.xml文件了抑月,它在webapp的WEB-INF下。
有個注意點:一般工程默認創(chuàng)建web.xml的時候有個規(guī)定的順序添加操作限定舆蝴。詳情看此處
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<display-name>Archetype Created Web Application</display-name>
<!-- spring加載前端控制器 -->
<!-- 如果是用mvn命令生成的xml谦絮,需要修改servlet版本為3.1 -->
<!-- 配置DispatcherServlet -->
<servlet>
<servlet-name>seckill-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 配置springMVC需要加載的配置文件
spring-dao.xml,spring-service.xml,spring-web.xml
Mybatis - > spring -> springmvc
-->
<!-- 加載spring容器監(jiān)聽器 -->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-*.xml</param-value>
</init-param>
</servlet>
<!-- url模式 -->
<servlet-mapping>
<servlet-name>seckill-dispatcher</servlet-name>
<!-- 默認匹配所有的請求 -->
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- 亂碼過濾器 -->
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- druid -->
<servlet>
<servlet-name>DruidStatView</servlet-name>
<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
<init-param>
<!-- 用戶名 -->
<param-name>loginUserName</param-name>
<param-value>admin</param-value>
</init-param>
<init-param>
<!-- 登錄密碼 -->
<param-name>loginPassword</param-name>
<param-value>123456</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DruidStatView</servlet-name>
<url-pattern>/druid/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>DruidWebStatFilter</filter-name>
<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
<init-param>
<param-name>exclusions</param-name>
<param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>DruidWebStatFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
接下來就是測試啦A饨浴!
(1)測試mybatis與spring是否整合好:
編寫我們自己的bean先
public class Score {
private Long id;
//積分變化類型
private String changeType;
//創(chuàng)建時間
private Date createTime;
//積分變化數
private Integer score;
//愛豆變化者
private User user;
//省略無參構造器挨稿,全參構造器仇轻,以及一系列的getset
}
(2)然后就是編寫接口嘛:
public interface ScoreDao {
//插入積分記錄
int insertScore(Score score);
}
(3)接著就寫mapper。注意奶甘,這里不需要實現dao接口不用編寫daoImpl篷店, mybatis會給我們動態(tài)實現,但是我們需要編寫相應的mapper臭家。
因為使用IDEA開發(fā)疲陕,本博主發(fā)現我們的mapper類只能建立在resources目錄下,而不能建立在java的包下面钉赁。不然會映射不了蹄殃。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuzhu.dao.ScoreDao">
<insert id="insertScore" parameterType="com.fuzhu.entity.Score">
INSERT INTO score (change_type,score)
VALUES (#{changeType},#{score})
</insert>
</mapper>
(4)編寫測試用例:然后直接Junit測試即可!你踩!這就測試完dao層啦W缪摇!带膜!
@RunWith(SpringJUnit4ClassRunner.class) // 使用Springtest測試框架
@ContextConfiguration("/spring/spring-*.xml") // 加載配置
public class MyBatisTest {
@Autowired
private ScoreDao scoreDao;
@Test
public void testAddScore() {
Score score = new Score();
score.setChangeType("充錢錢");
score.setScore(10);
int insert = scoreDao.insertScore(score);
System.out.print("insert :"+insert);
}
}
(5)接著吩谦!我們要測試整個框架,也就是要用SpringMVC給展示出來嘛膝藕!先寫個業(yè)務邏輯接口式廷!
public interface ScoreService {
//插入積分記錄
public int insertScore(Score score);
}
編寫接口實現類嘛。(注意IDEA的無故標紅不用管芭挽,我們要可以先部署跑一下滑废,被坑了,IDEA標志dao無法裝配袜爪,實際上已經裝配成功的蠕趁,畢竟上一步測試已經測試成功。)
@Service
public class ScoreServiceImpl implements ScoreService{
@Autowired
private ScoreDao scoreDao;
@Override
public int insertScore(Score score) {
int t =scoreDao.insertScore(score);
return t;
}
}
最后就寫下controller給springmvc解析視圖出來嘛饿敲。這樣就整個框架測試成功啦F薜肌9涿唷怀各!
@RestController
@RequestMapping("/test")
public class TestController {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ScoreService scoreService;
@RequestMapping(value = "/testMethod",produces="text/html;charset=UTF-8", method = {RequestMethod.GET,RequestMethod.GET})
public String test() {
Score score = new Score();
score.setChangeType("玩游戲");
score.setScore(10);
scoreService.insertScore(score);
return JSON.toJSONString(score);
}
}
二、Redis單機版以及測試
(測試以查禁言表為例子)
(1)MAVEN拉下redis的庫
(2)編寫單機版redis配置
<?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.xsd">
<!-- 本jedis的jar為2.7.0版本 -->
<!-- jedisPool配置信息 -->
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxTotal" value="1000"/> <!-- 控制一個pool可分配多少個jedis實例 -->
<property name="maxIdle" value="200" /> <!-- 控制一個pool最多有多少個狀態(tài)為idle(空閑)的jedis實例 -->
<property name="maxWaitMillis" value="2000" /> <!-- 表示當borrow一個jedis實例時术浪,最大的等待時間瓢对,如果超過等待時間,則直接拋出JedisConnectionException -->
<property name="testOnBorrow" value="true" /> <!-- 在borrow一個jedis實例時胰苏,是否提前進行validate操作硕蛹;如果為true,則得到的jedis實例均是可用的 -->
</bean>
<!-- jedis客戶端單機版配置 -->
<bean id="jedisPool" class="redis.clients.jedis.JedisPool" scope="singleton">
<constructor-arg name="poolConfig" ref="jedisPoolConfig" />
<constructor-arg name="host" value="127.0.0.1"></constructor-arg>
<constructor-arg name="port" value="6379"></constructor-arg>
</bean>
<bean id="jedisClient" class="com.fuzhu.serviceImpl.JedisClientSingle" />
</beans>
(3)基本業(yè)務代碼先:
public interface GagDao {
public int insertGag(Gag gag);
List<Gag> findByUserId(Long id);
}
GagMapper
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuzhu.dao.GagDao">
<insert id="insertGag" parameterType="com.fuzhu.entity.Gag">
INSERT INTO gag (gag_time,user_id)
VALUES (#{gagTime},#{user.id})
</insert>
<select id="findByUserId" resultType="com.fuzhu.entity.Gag" parameterType="long">
SELECT
*
FROM
gag
WHERE
user_id = #{id}
</select>
</mapper>
業(yè)務的接口以及實現
public interface GagService {
public int insertGag(Gag gag);
List<Gag> findByUserId(Long id);
}
@Override
public List<Gag> findByUserId(Long id) {
List<Gag> gagList=gagDao.findByUserId(id);
return gagList;
}
(4)緩存的設計和調用:
前言:禁言表這種東西可能會被經常查的,而已難變固定的法焰,就把整個表緩存到redis中嘛秧荆。
controller代碼:
//裝配需要的東東先!埃仪!
@Autowired
private GagService gagService;
@Autowired
private JedisClient jedisClient;
//再寫個業(yè)務方法
//基本思路:有沒有查過禁言表乙濒,有查過就往redis拿,null的話就去數據庫拿卵蛉,拿完再把數據set進緩存0涔伞!
@RequestMapping(value = "/testRedis",produces="text/html;charset=UTF-8", method = {RequestMethod.GET,RequestMethod.GET})
public String testRedis(Long id){
List<Gag> gagList= null;
try {
String resulthget = jedisClient.hget("禁言表", id + "");
if (resulthget != null) {
//字符串轉為list
System.out.println("有緩存啦啦啦I邓俊8视小!");
JSONArray array = JSONArray.parseArray(resulthget);
gagList = (List) array;
} else {
System.out.println("禁言表沒查過");
gagList= gagService.findByUserId(id);
}
} catch (Exception e) {
e.printStackTrace();
}
try {
String cacheString = JsonUtils.objectToJson(gagList);
jedisClient.hset("禁言表", id + "", cacheString);
} catch (Exception e) {
e.printStackTrace();
}
return JSON.toJSONString(gagList);
}
到此就收工啦该互,redis植入成功!韭畸!yes宇智!
好了,J2EE項目系列(四)--SSM框架構建積分系統(tǒng)和基本商品檢索系統(tǒng)(Spring+SpringMVC+MyBatis+Lucene+Redis+MAVEN)(1)框架整合構建講完了胰丁。本博客系列是我做項目時候需要整合的部分東西(分布式的往后補上)随橘,我把里面的整合,以及部分非算法性的業(yè)務邏輯寫出來锦庸,分享經驗給大家机蔗。歡迎在下面指出錯誤,共同學習8氏簟萝嘁!你的點贊是對我最好的支持!扬卷!